in reply to hash assignment using map with multiple statements
With just a little tidying the for loop version looks much better and is easier to understand (at least for me) than the map version. Consider:
foreach (@teststr) { my $val = (split /\//)[-1]; $testhash{substr $val, 0, index $val, '.txt'} = $val; }
|
|---|