zing has asked for the wisdom of the Perl Monks concerning the following question:
The problem is that it isnt writing anything to the output file. Due to certain reasons I want to read in the input file in <DATA> format, so that cant be done away with. Please helpuse strict; use warnings; use autodie; # check that two arguments have been passed die "usage: $0 input output\n" unless @ARGV == 2; my $infile = shift; my $outfile = shift; open my $in, "<", $infile; open(DATA,$in); open my $out, ">", $outfile; ins split /,\s*/ for <DATA>; print $out "%-4s: %20s, %-8s %6s\n", $_->[0], qq($_->[0]$_->[3]) +, $_->[2], $group{$_->[2]}; close $in; close $out;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to write output to file taken as input from command line
by choroba (Cardinal) on Jul 24, 2014 at 13:03 UTC | |
|
Re: Unable to write output to file taken as input from command line
by muba (Priest) on Jul 24, 2014 at 13:03 UTC | |
|
Re: Unable to write output to file taken as input from command line
by Anonymous Monk on Jul 24, 2014 at 13:45 UTC | |
by zing (Beadle) on Jul 24, 2014 at 14:21 UTC | |
by GotToBTru (Prior) on Jul 24, 2014 at 14:53 UTC | |
by graff (Chancellor) on Jul 25, 2014 at 02:48 UTC | |
by graff (Chancellor) on Jul 25, 2014 at 02:59 UTC |