prefer $@ for eval errors
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 16 Feb 2015 17:30:52 +0000 (18:30 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 19 Feb 2015 23:21:52 +0000 (00:21 +0100)
browser.plp
digits.plp
latin.plp
sc.plp
screen.plp
writing.plp

index ad8690f2781e0d4902aae5ac8723befc5e4ae733..375f3005ea468568f0b04f1ced14f46be1b128c4 100644 (file)
@@ -22,7 +22,7 @@ Html({
 
 say "<h1>Browser compatibility</h1>\n";
 
 
 say "<h1>Browser compatibility</h1>\n";
 
-my $caniuse = do 'data/browser/support.inc.pl' or die $! || $@;
+my $caniuse = do 'data/browser/support.inc.pl' or die $@ || $!;
 $_->{verrelease} = {
        # mark last three (future) versions as unreleased, ensure current isn't
        map {
 $_->{verrelease} = {
        # mark last three (future) versions as unreleased, ensure current isn't
        map {
@@ -99,7 +99,7 @@ given ($get{usage} // 'wm') {
                        'identifier must be alphanumeric name or <q>0</q>';
        }
        $canihas = do "data/browser/usage-$_.inc.pl" or do {
                        'identifier must be alphanumeric name or <q>0</q>';
        }
        $canihas = do "data/browser/usage-$_.inc.pl" or do {
-               printf "<p>Browser usage data not found: <em>%s</em>", $! || $@;
+               printf "<p>Browser usage data not found: <em>%s</em>", $@ || $!;
                break;
        };
        $usage = $_;
                break;
        };
        $usage = $_;
index 10311511b73a1c71b6aff83a003b939728ac20e1..ec0d7ff1948a3dc65d839fe1078f2466bded3dc0 100644 (file)
@@ -36,7 +36,7 @@ my $scriptname = do 'writing-script.inc.pl';
 $_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
 
 my @table = do "writing-digits.inc.pl";
 $_ = qq{<a href="/latin">$_</a>} for $scriptname->{latn} || ();
 
 my @table = do "writing-digits.inc.pl";
-die "Table data not found: <em>$_</em>.\n" for $! || $@ || ();
+die "Table data not found: $_\n" for $@ || $! || ();
 
 $glyphs->print([map {
        ref $_ eq 'ARRAY' ? @{$_} : map { ".>$_" }
 
 $glyphs->print([map {
        ref $_ eq 'ARRAY' ? @{$_} : map { ".>$_" }
index f8472d7e4698641aa4642ad649690b239bb01ca3..7723bf1eba772ee0ac07485e86cd196d9b2eac15 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -53,7 +53,7 @@ my %scriptname = (
 
 my @table = do 'writing-latn.inc.pl';
 if ($! or $@) {
 
 my @table = do 'writing-latn.inc.pl';
 if ($! or $@) {
-       printf "<p>Table data not found: <em>%s</em>.</p>\n", $! || $@;
+       printf "<p class=error>Table data not found: <em>%s</em>.</p>\n", $@ || $!;
 }
 else {
        print $glyphs->table([map {
 }
 else {
        print $glyphs->table([map {
diff --git a/sc.plp b/sc.plp
index 23d29ec7d87f69478348f2738679faaf7f8e9df3..7207117f79831f6f3928ae7bd33d6e24f10e418d 100644 (file)
--- a/sc.plp
+++ b/sc.plp
@@ -236,7 +236,7 @@ sub showrange {
        }
 
        my $units = do 'sc-units.inc.pl';
        }
 
        my $units = do 'sc-units.inc.pl';
-       die "Cannot open unit data: $_\n" for $! || $@ || ();
+       die "Cannot open unit data: $_\n" for $@ || $! || ();
        my $grouped = !exists $get{order};
        if (exists $get{order}) {
                $get{order} ||= '';
        my $grouped = !exists $get{order};
        if (exists $get{order}) {
                $get{order} ||= '';
index 02673ad168ecdb770b10ba265f216ee3a02d6a03..0e188c19c3c4f05955f3eb7eb06865147a92f83e 100644 (file)
@@ -22,7 +22,7 @@ Html({
 
 <:
 use Shiar_Sheet::Keyboard 2;
 
 <:
 use Shiar_Sheet::Keyboard 2;
-my $info = do 'screen.inc.pl' or die $! // $@;
+my $info = do 'screen.inc.pl' or die $@ // $!;
 my $keys = Shiar_Sheet::Keyboard->new($info);
 $keys->map($get{map}) or undef $get{map};
 $keys->print_rows($get{rows});
 my $keys = Shiar_Sheet::Keyboard->new($info);
 $keys->map($get{map}) or undef $get{map};
 $keys->print_rows($get{rows});
index 8ea9a0c970c7442aba681d895ff1dcb8ebcb8821..e26b6550de3d2656f6a464ef55f4429c46aa5d1d 100644 (file)
@@ -46,7 +46,7 @@ for (
        my @table = do "writing-$source.inc.pl";
        if ($! or $@) {
                print "<h2>$title</h2>\n";
        my @table = do "writing-$source.inc.pl";
        if ($! or $@) {
                print "<h2>$title</h2>\n";
-               printf "<p>Table data not found: <em>%s</em>.</p>\n", $! || $@;
+               printf "<p>Table data not found: <em>%s</em>.</p>\n", $@ || $!;
                next;
        }
        $glyphs->print($title => [map {
                next;
        }
        $glyphs->print($title => [map {