XP is just a number | |
PerlMonks |
perl calls die() as a methodby kappa (Chaplain) |
on Aug 18, 2005 at 14:08 UTC ( [id://484783]=perlquestion: print w/replies, xml ) | Need Help?? |
kappa has asked for the wisdom of the Perl Monks concerning the following question:
Good day, fellow monks!
Yes, perl does consider my die an indirect object method call. I checked with B::Deparse. And the question is -- how to prevent the situation? My code (I tried to implement something like My::Exception class from this perl.apache.org doc) is below. File AA/BB.pm File testdie.pl: Deparsed test.pl:
I'd really like to throw exceptions without additional parens like this: die MyApp::Error->new() and this very syntax is everywhere on the web. Ah, and this is perl 5.6.2. Update: looks like a bug fixed somewhere between 5.6.2 and 5.8.7. So the new question is: is there a way to force die() as a sub? Upgrading perl is not an option for me due to different Unicode :(
--kap
Back to
Seekers of Perl Wisdom
|
|