omit source code position in regex error message
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Sep 2019 14:54:18 +0000 (16:54 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Sep 2019 18:16:38 +0000 (20:16 +0200)
barcat

diff --git a/barcat b/barcat
index 6d5610996a00f7b7c614d67a26956ac162fe2ff4..b75bf987f48ae4fe2f6de7473893ca540d074232 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -21,7 +21,7 @@ GetOptions(\%opt,
                eval {
                        local $_ = $_[1];
                        $opt{anchor} = /^[0-9]+$/ ? qr/(?:\S*\h+){$_}\K/ : qr/$_/;
-               } or die "$@ for option $_[0]\n";
+               } or die $@ =~ s/(?: at .+)?$/ for option $_[0]/r;
        },
        'human-readable|H!',
        'interval|t:i',