in reply to Changing data output

Or you could use a regexp substitution....as usual TMTOWTDI

my @files = qw( /mydirectory/directory/test/z2.htm /mydirectory/directory/other/testhere.htm /mydirectory/directory/test/dir/z6.htm ); foreach ( @files ) { s/^(\/\w+\/\w+\/)//; print "$_\n"; }
Updated explanation: This regexp will match any words as the first two directories and remove them. If you have specific directories in mind, replace each \w+ with the directory names you want removed.

-Kurt