in reply to grep and $_
I think the main problem you are having is the implicit loop that grep creates. grep actually creates another loop which sets $_.
Also your outside loop over @required never sets $_ since you explicitly create a variable.
ex.
my @required = qw(preserver sunscreen water_bottle jacket); foreach my $item (@required) { print "$_\n"; ## You just get a warning }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: grep and $_
by convenientstore (Pilgrim) on Aug 11, 2007 at 23:38 UTC | |
by mreece (Friar) on Aug 11, 2007 at 23:58 UTC |