superfrink has asked for the wisdom of the Perl Monks concerning the following question:
# find lines with keywords foreach my $i (@keywords) { ## -- LINE 40 -- if($line =~ m/$i/i) { # copy found lines to the found lines array push @found , $line; } }
# find lines with keywords my $i; foreach $i (@keywords) { ## -- now LINE 41 -- if($line =~ m/$i/i) { # copy found lines to the found lines array push @found , $line; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Missing $ on loop variable
by gu (Beadle) on Dec 02, 2005 at 21:01 UTC | |
|
Re: Missing $ on loop variable
by psychotic (Beadle) on Dec 02, 2005 at 21:09 UTC | |
by revdiablo (Prior) on Dec 02, 2005 at 21:21 UTC | |
by psychotic (Beadle) on Dec 02, 2005 at 21:52 UTC | |
by revdiablo (Prior) on Dec 03, 2005 at 02:32 UTC | |
by psychotic (Beadle) on Dec 03, 2005 at 14:39 UTC | |
| |
by superfrink (Curate) on Dec 02, 2005 at 21:51 UTC | |
|
Re: Missing $ on loop variable
by robin (Chaplain) on Dec 02, 2005 at 22:55 UTC | |
by superfrink (Curate) on Dec 02, 2005 at 23:18 UTC | |
by robin (Chaplain) on Dec 02, 2005 at 23:38 UTC | |
by japhy (Canon) on Dec 03, 2005 at 04:37 UTC |