in reply to Re^2: Empty output file with Red Hat
in thread Empty output file with Red Hat
To avoid puzzling problems with missing data files, test your input with something along these lines:
Then you'll know when you've got no data file to work on.#!/usr/bin/perl if (!defined $ARGV[0]) { # make sure some input is given die "No input file provided: $!"; } elsif (!-f $ARGV[0]) { # input is not a file die "Input $ARGV[0] not available as a file"; }
Also suggested is the use of "use warnings" and "use strict" at the beginning of nearly every Perl program.
non-Perl: Andy Ford
|
|---|