Don't use split. Try this instead.
'/home/bin/scripts/test.pl' =~ m{([^/]+)$} or die "Didn't match"; my $fname = $1;
If you really wanted to use split then you could write this as my $fname = (split '/', '/home/bin/scripts/test.pl)[-1];
Seeking Green geeks in Minnesota
In reply to Re: Using split
by diotalevi
in thread Using split
by nite_man
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |