Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl Question on Pattern Matching

Name: Anonymous 2011-06-03 19:08

Okay this simple thing matches words that has an a e i o u, but how do I make it so that it matches it in the specific order for a e i o u

Example abstemious

foreach $v(@lines)
{
    if(($v =~ /a/) && ($v =~ /e/) && ($v =~ /i/) && ($v =~ /o/) && ($v =~ /u/))
    {
        print $v;
    }
}

Name: Anonymous 2011-06-03 20:44

>>8
That's because you're modifying the global variable there. You need to use my.

$a = 2;
my $b = 2;
$c = 2;
 
sub dostuff() {
  $a = $a + 1;
  my $b = $b + 1;
  my $c = $c + 1;
}
 
&dostuff;
 
print "a: $a  b: $b c: $c\n";


Don't blame the language if you fuck up.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List