Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Perl 5.12.0 has been released!

by wazoox (Prior)
on Apr 13, 2010 at 14:42 UTC ( #834504=note: print w/ replies, xml ) Need Help??


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

The name of the operator is awesome! Unfortunately it looks like it can't be overloaded, which would have been really useful. Feature request!


Comment on Re^3: Perl 5.12.0 has been released!
Re^4: Perl 5.12.0 has been released!
by BrowserUk (Pope) on Apr 13, 2010 at 15:02 UTC

    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.

      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
Node Status?
node history
Node Type: note [id://834504]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2014-08-31 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls