# Note: strFileA = C:\foo\a\b\c\123.xml my @aryFile = split (/\//, $strFileA); my $intSize = @aryFile; $strFileB= \$aryFile[$intSize-1];