Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: special character question

by tobyink (Abbot)
on Mar 03, 2013 at 23:25 UTC ( #1021544=note: print w/ replies, xml ) Need Help??


in reply to special character question

perlvar tells you all you need to know about Perl's special variables.

If a fatal error occurs within an eval call, the error message is stored in $@, and execution resumes from after the eval.

So the code in your example calls a function called store and if that raises a fatal error, prints it to STDOUT.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name


Comment on Re: special character question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2015-07-29 03:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls