in reply to Substitution query

Yeah, it can be done on the next line after your tr:

$fn =~ s/gpfs_data/nas\/rdds/;

You definitely don't want to loop through the entire @allpathlisting array every time you add a single new file to it.

Replies are listed 'Best First'.
Re^2: Substitution query
by Anonymous Monk on Nov 20, 2014 at 05:58 UTC

    Thanks for that it fixed the speed, I get the reason now.

    However this bit

    $fn =~ s/gpfs_data/nas\/rdds/;

    is still producing a rogue forward slash in my path

    \\nas/rdds\open\

      Then change the substitution text to nas\\rdds instead.