$file =~ s/TGZ/tar/; $dir = $file; $dir =~ s!\.S75\.T...tar!\/Invoices\/!; if ($file =~ /(PROD.OPTBL.X.K.)(R*)(.S75.T11.tar)/) { $run=$2; } $command = "pax -r -f $file -s'!$dir!/data/kev/atlanta/emtex/invoices/R$run/!p'";