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

Another regexp if you don't need the path:
my $string = "/alex/samsung/t2"; $string =~ m/([^\/]+)$/; print $1, "\n";