Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^4: RFC: The lightning-rod operator

by martin (Friar)
on Jan 30, 2016 at 17:09 UTC ( [id://1154073]=note: print w/replies, xml ) Need Help??


in reply to Re^3: RFC: The lightning-rod operator
in thread RFC: The lightning-rod operator

I'd rather prefer a catch_undef { BLOCK } command, because the block would be explicit about what is caught without much explanation.

While throwing exceptions or returning early from subroutines are indeed ways of taking short-cuts, it is tricky to get the amount of control I am looking for with existing language constructs.

Keep in mind that the suggested operator does not need something that would trigger a warning or error to work, nor would it change the behaviour of similar warnings in the same block.

The method calling chain $a->foo->bar^^->baz->qux, say, would give us a short-cut after bar() but nowhere else. Likewise, the dereferencing chain $a->[1]->[2]^^->[3] would autovivify $a->[1] but not $a->[1]->[2].

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-23 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found