Here is how I would probably have written your program given my current boilerplate.
#!/usr/bin/env perl use 5.10.1; use utf8; use strict; use warnings; use open qw(:std IO :utf8); use charnames qw(:full); use Carp qw(carp cluck croak confess); ################################################## $SIG{__DIE__} = sub { confess "Uncaught exception: @_" unless $^S; }; $SIG{__WARN__} = sub { if ($^S) { cluck "Trapped warning: @_" } else { confess "Deadly warning: @_" } }; END { unless (close STDOUT) { die "can't close stdout: $!"; } } ################################################## my $filename = "/tmp/lol.text"; open(ERASE, "> $filename") || die "can't overwrite/create $filename: $!"; say ERASE "LOL \N{WHITE SMILING FACE}"; close(ERASE) || die "can't close $filename: $!"; exit 0;
In reply to Re: unquoted string error??!!
by tchrist
in thread unquoted string error??!!
by aji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |