So I have a hash table like this:
M => 1
S => 50
I want to do something like this:
$var = map { "$hash{$_}"."$_\n" } keys %hash;
print $var;
so that I end up with a variable to print that looks like:
1M50S
Unfortunately the map statement doesn't work :( And yes it must be assigned to a variable because it is in an if statement and changes depending on conditions. Is there a nice clean way of doing this?
mapfunction works just fine, by the way. :)