- or download this
$ perl -E 'open my $fh, ">", "xxx"; close $fb; open my $fh, ">", "yyy"
+'
$
- or download this
$ perl -E 'use strict; use warnings; open my $fh, ">", "xxx"; close $f
+b; open my $fh, ">", "yyy"'
"my" variable $fh masks earlier declaration in same scope at -e line 1
+.
...
Execution of -e aborted due to compilation errors.
ken@ganymede: ~/tmp
$
- or download this
$ perl -E 'use strict; use warnings; { open my $fh, ">", "xxx"; } open
+ my $fh, ">", "yyy"'
$
- or download this
use strict;
use warnings;
- or download this
die "CANNOT OPEN LOG";
- or download this
die "CANNOT OPEN LOG '$logfilename': $!";
- or download this
select $fh;
print "...";
...
print "...";
select STDOUT;
print "...";
- or download this
print $fh "...";
print STDERR "...";
print "...";
- or download this
my $open_ok = open my $fh, $mode, $filename;
if (not $open_ok) {
# custom error handling here
}
- or download this
#!/tps/bin/perl
...
print $fh "...";
print "...";
}