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: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
