Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 having an uproarious good time at the Monastery: (6)
As of 2016-02-14 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (470 votes), past polls