in reply to unable chec whether the word is intermediate or last word in a sentence
use Path::Class qw( file dir ); my $base = dir('c:\\abc\\def'); my $node = file('c:\\abc\\def\\ghi\\jkl'); # or dir() print $node->relative($base), "\n"; [download]
Path::Class