in reply to Re^4: Take reference and then dereference die() and warn()
in thread Take reference and then dereference die() and warn()
OK, I understand your motivations, now.
You still have numerous simpler ways to do it, such as storing your long error message in a variable (you actually had a $error variable in your original post) or doing something like this:
or, yet simpler, using a subroutine such as the one proposed by Jenda in this post: Re: Take reference and then dereference die() and warn().$ perl -e 'use diagnostics; $die_on_err=shift; 0 or print "error messa +ge" and ($die_on_err? die $! : warn "\n" ) ' 0 error message
|
|---|