Hi,

 I am a newbie and need your help. The following script doesn't
display the first print statement like the second one.
 Why?

@str = qw(NEW food foosball newstr foobasefoot);

$\ = "\n";

foreach(@str)
{
        print "First: $&" if ?(foo.*)?;
        print "Second: $&" if /(foo.*)/;
}

Output:

First: food
Second: food
Second: foosball
Second: foobasefoot


Regards,
Durai

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to