Help for this page
#!/usr/bin/perl -w use strict; ... my %testhash = map { m{(([^/]+)\.[^/]+)$}; $2, $1 } @teststr; print "$_ => $testhash{$_}\n" for sort keys %testhash;
file1 => file1.txt file2 => file2.txt file3 => file3.txt file4 => file4.txt