in reply to Re^2: warnings and grep problem
in thread warnings and grep problem
You're attempting to use the number of keys which matched to initialize a hash. Trying to use a single scalar to initialize a hash isn't going to produce anything useful.
my @desired_keys = grep { /\Q$dir\E.*?\.pm$/ } keys %$packlist; my %hash; @hash{ map { /\Q$dir\E(\w+?)\.pm$/; $1 } @desired_keys } = @desired_ke +ys;
Update: Gah. Me no write well. Reworded to (hopefully) clarify.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: warnings and grep problem
by jeanluca (Deacon) on Jun 20, 2006 at 16:36 UTC |