in reply to funky $_ with map {}
Do you really need anonymous subs to solve your problem? Would this work instead?my %hash = map {$_ => sub {return "<H1>$_</H1>"} } (1..5); $_ = 'foo'; print &{$hash{2}};
Seems much more simple and usable to me ...my %hash = map {$_ => "<H1>$_</H1>" } (1..5);
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (jeffa) Re: funky $_ with map {}
by Anonymous Monk on Mar 02, 2002 at 20:37 UTC | |
by Juerd (Abbot) on Mar 02, 2002 at 23:31 UTC |