X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/a417d6d86568e94d5670d68221613b8e56efdf4d..9e1e2b150d99770d3b6dbe83e458c80a371ebcff:/barcat diff --git a/barcat b/barcat index 3e1980d..b75bf98 100755 --- a/barcat +++ b/barcat @@ -18,7 +18,10 @@ GetOptions(\%opt, 'color|c!', 'C' => sub { $opt{color} = 0 }, 'field|f=s' => sub { - $opt{anchor} = /^[0-9]+$/ ? qr/(?:\S*\h+){$_}\K/ : $_ for $_[1]; + eval { + local $_ = $_[1]; + $opt{anchor} = /^[0-9]+$/ ? qr/(?:\S*\h+){$_}\K/ : qr/$_/; + } or die $@ =~ s/(?: at .+)?$/ for option $_[0]/r; }, 'human-readable|H!', 'interval|t:i',