Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: 'state' variables and unit testing

by vsespb (Hermit)
on Feb 01, 2014 at 20:44 UTC ( #1072994=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $cached_value{ is_64bit_machine() } ||= somelongfunction()
    
  2. or download this
    sub global_sum {
      state $sum = 0;
      $sum += $_[0];
      $sum;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-08-28 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls