in reply to regex die?

Wouldn't something like this suffice?
sub die_clean { my ($err) = @_; my ($rmk, $msg) = map {scalar reverse} split(/ ta /, reverse($err), +2); my ($line) = ($rmk =~ /line (\d+)/; }
You can even have the word 'at' in the error message.


acid06
perl -e "print pack('h*', 16369646), scalar reverse $="

Replies are listed 'Best First'.
Re^2: regex die?
by nmerriweather (Friar) on Mar 20, 2006 at 21:45 UTC
    the split at 'ta' is probably as bad as splitting on at.. BUT... reversing the string and then regexing might be worth stabbing at. i know regex has ^$, but that might be more natural to write with
      Find a breakage and I'll buy you a beer.


      acid06
      perl -e "print pack('h*', 16369646), scalar reverse $="