Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This one works as expected with only slight modification:%hash = map { $_, "$var/$_" } @array; # Works great %hash = map { "$var/$_", $_ } @array; # Syntax Error!
Thanks%hash = map { "$var/".$_, $_ } @array; # Also works.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using map to assign to a hash
by jeffa (Bishop) on Jun 08, 2004 at 15:30 UTC | |
|
Re: Using map to assign to a hash
by BrowserUk (Patriarch) on Jun 08, 2004 at 15:30 UTC | |
|
Re: Using map to assign to a hash
by Grygonos (Chaplain) on Jun 08, 2004 at 17:00 UTC |