in reply to Remove the location of error from error messages from croak

see inside Carp::Always
  • Comment on Re: Remove the location of error from error messages from croak

Replies are listed 'Best First'.
Re^2: Remove the location of error from error messages from croak
by Anonymous Monk on Jul 01, 2014 at 17:20 UTC
    eval{ die 1; }; warn $@; $SIG{__DIE__} = sub{ my( $err ) = @_; $err=~ s/ at .*? line \d+.$/\n/; die $err; }; die 2; __END__ 1 at - line 1. 2
      let's hope no filename will ever contain the substring " at " ! ;-)

      Cheers Rolf

      (addicted to the Perl Programming Language)

        spaces in filenames is hangable offense :)