On Wednesday 22 August 2001 11:31, Troy Denkinger wrote:
> On Wednesday 22 August 2001 11:58, webmaster wrote:
> > #!/usr/bin/perl
> > $REPORT_file="report.htm";
> > $ imput_file=$ARGV[0]||'imput.dat';
> > unless (-e $imput_file)
> > {
> > die "$0: error:missing file: $imput_file";
> > }
> > open (IN, $imput_file) or die "$0 : error: $imput_file: $!";
>
> All of this ( except the #! line ) can be replaced by this:
>
> open( IN, shift ) or die( "Open failed: $!" );
Attention issues today. This single line of code should have been:
my $input_file = shift || "input.dat";
open( IN, $input_file ) or die( "Open failed: $!" );
I missed the default file name bit.
Regards,
Troy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]