in reply to how to redirect output in different files

#!perl use strict; my $infile = $ARGV[0]; (my $outfile = $infile) =~ s/^list/out/; $outfile = 'outfile/'.$outfile; open my $h_in,'<',$infile or die "Can't open $infile for reading: $!"; open my $h_out,'>',$outfile or die "Can't open $outfile for writing: $ +!"; print "$infile -> $outfile \n"; while( my $line = <$h_in> ) { $line =~ s/\s+/\n/g; print $h_out $line; } close $h_in; close $h_out;
poj