X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/a417d6d86568e94d5670d68221613b8e56efdf4d..9311bd5ea1a9b062c2a1f88fe768829ffc3c004b:/barcat diff --git a/barcat b/barcat index 3e1980d..6d56109 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 "$@ for option $_[0]\n"; }, 'human-readable|H!', 'interval|t:i',