in reply to Re: split string and always get last word
in thread split string and always get last word

A two line equivelent example:

my ($string, $string2) = ("./t2", "/some/path/to/t3"); print join "\n", map {(split /\//)[-1]} ($string, $string2);

Prints:

t2 t3

This is about "get last word" isn't it :)


DWIM is Perl's answer to Gödel