I am trying to replace characters in file through perl regex like :
open my $hfile, $ARGV or die "Can't open $ARGV for reading: $!"
while( my $line = <$hfile> )
$line =~ s/\s+/\n/g;
I have to run this script for all the files in my folder so I use following command described previously in this forum as
for %f in (*.txt) do @yourscript.pl %f
It works fine but I want to save the output generated by each input file in a subfolder. For example if my current folder contains the files named list1.txt, list2.txt etc.. an 'outfile' subfolder should generate and the results for each file shouls ve saved in it as out1.txt, out2.txt etc.. But I don't know how to do that..Plz help