Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Perl 5.12.0 has been released!

by BrowserUk (Patriarch)
on Apr 13, 2010 at 15:02 UTC ( [id://834508]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Perl 5.12.0 has been released!
in thread Perl 5.12.0 has been released!

Seems to me that this is more useful:

BEGIN{ *CORE::GLOBAL::die = sub{ CORE::die( $_[0] //'Unimplemeted' ); +} }

A bare die (same number of characters), will be converted to Unimplemented at ....

And it can also be used a sub-statement like open O, '<', 'fred' or die;

I guess it doesn't have the cache' of ...?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^5: Perl 5.12.0 has been released!
by ambrus (Abbot) on Apr 14, 2010 at 09:43 UTC

    A bare die rethrows a caught exception (from $@) so it can't be reused for this without breaking compatibility.

      At the expense of one more character you could use:

      c:\test>perl -wle"sub TODO{ die 'Unimplemented' } 0 or TODO;" Unimplemented at -e line 1.

      with the same benefits. Or perhaps one of these:

      c:\test>perl -wle"sub _'_'_{ die 'Unimplemented' } 0 or _'_'_;" Unimplemented at -e line 1. c:\test>perl -wle"sub ___{ die 'Unimplemented' } 0 or ___;" Unimplemented at -e line 1.

      I quite like that last one. And it has the added benefit of not requiring the use of a dog slow "real parser" to not confuse my syntax highlighter!

      But perhaps it is more about the changes that allowed yadayada to be implemented, than yadayada itself.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://834508]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-19 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found