Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^4: closure clarity, please

by ikegami (Pope)
on Nov 24, 2009 at 20:52 UTC ( #809205=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Foo;
    
    ...
    sub get_x { die("uninitialized") if !defined($x); $x }
    
    1;
    
  2. or download this
    {
        my $x;
        sub set_x { validate($_[0]); $x = $_[0]; }
        sub get_x { die("uninitialized") if !defined($x); $x }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2014-12-27 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls