Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Avoiding Global Vars

by bv (Friar)
on Sep 22, 2009 at 16:17 UTC ( #796746=note: print w/replies, xml ) Need Help??


in reply to Avoiding Global Vars

You could wrap it in a block:

{ my $max; while(<>) { $max = ($max >= $_ ? $max : $_); print "Max seen: $max\n"; } }

Or use a state variable (Perl 5.10 or 6 only, I believe)

print pack("A25",pack("V*",map{1919242272+$_}(34481450,-49737472,6228,0,-285028276,6979,-1380265972)))

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2023-12-02 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (13 votes). Check out past polls.

    Notices?