Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: 'state' variables and unit testing

by vsespb (Chaplain)
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 imbibing at the Monastery: (6)
As of 2016-06-25 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (325 votes). Check out past polls.