Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: What operator should perl5porters use for safe dereferencing?

by thomas895 (Hermit)
on May 29, 2012 at 16:01 UTC ( #973057=note: print w/ replies, xml ) Need Help??


in reply to Re^2: What operator should perl5porters use for safe dereferencing?
in thread What operator should perl5porters use for safe dereferencing?

Safe, while perhaps not the best example, does allow execution without the risk of your program dieing. I guess it's for the folks who have something against eval.

~Thomas~
I believe that the source code to life is written in Perl :-)


Comment on Re^3: What operator should perl5porters use for safe dereferencing?
Select or Download Code
Re^4: What operator should perl5porters use for safe dereferencing?
by Anonymous Monk on May 29, 2012 at 16:30 UTC
    Um, no, eval prevents dieing, Safe prevents ops you don't allow (in theory) like exit, system, etc

      Safe can -- if (ab)used correctly -- prevent your program from dieing as well.

      ~Thomas~
      I believe that the source code to life is written in Perl :-)

        Safe can prevent die from being called, but not dying in general, or even due to "bad" derefs.

        If you wanted to change the behaviour of `->`, especially in a lexical scope, you could use an opcode checker. The autovivification pragma is an example of such.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-07-26 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls