in reply to strip substring from long string

As holli suggested you can make use of the above methods.

The string you have mentioned seems to be a path name, if it is so, you can make use of File::Basename.

use File::Basename; $str='/usr/local/prj/code/prog/prog1'; $name = basename("$str"); print "$name";

output:prog1

Prasad

update: added, use File::Basename;