#!/bin/perl use v5.12; use warnings; my $in = $ARGV[0]; if (! defined $in) { die "Usage: $0 filename"; } my $out = $in; $out =~ s/(\.\w+)?$/out/; if (! open my $in_fh, '<', $in ) { die "Can't open '$in': $!"; } if (! open my $out_fh, '>', $out) { die "Can't write '$out': $!";
Now I see this message:
Usage: ./exer_9_2 filename at ./exer_9_2 line 7.
I understand from all of the input, (many thanks to unknown friends), that once the if statement is completed then the message handle closes on its' own. I don't want to go a wider scope just yet as I want to get the basics down as far as opening & closing files. What is this current error telling me? Thanks, Catfish
In reply to Re: First attempt at bringing in file for input/output
by catfish1116
in thread First attempt at bringing in file for input/output
by catfish1116
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |