You assigned the output of the map to a scalar $has so you'll just get the number of elements map returned, not the actual elements. Then you did keys %hash which is a whole new variable. The following might do what you want, but if you are messing with path/file names then i would highly recommend use a CPAN module.
my @dirs = map { s/\Q$dir\E(\w+?)\.pm$/$1/ } keys %$packlist; for (@dirs) { print $_, "\n"; }
In reply to Re^3: warnings and grep problem
by eric256
in thread warnings and grep problem
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |