in reply to split "/" out of path
If you really want to split...
#!perl -w my $string = "/tmp/test/t1.out"; my $file = (split("/", $string))[-1]; print $file, $/; __END__ t1.out [download]