in reply to Changing data output

a regex substitute would also work
foreach my $file ( @LIST ) { $file =~ s/^\/mydirectory\/directory\//; next; }