in reply to Re^3: Unable to write output to file taken as input from command line
in thread Unable to write output to file taken as input from command line

You don't need to use chomp on values drawn from @ARGV. There's stuff in zing's code that doesn't make sense, but whatever the purpose may be, the basic template should be something like this:
die "Usage: $0 infile outfile\n" unless ( @ARGV == 2 ); my $infile = shift; my $outfile = shift; open( INPUT, '<', $infile ) or die "$infile: $!\n"; open( OUTPUT, '>', $outfile ) or die "$outfile: $!\n"; while (<INPUT>) { # do stuff with $_; # print something to OUTPUT }
  • Comment on Re^4: Unable to write output to file taken as input from command line
  • Download Code