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

Restricting a scalar to certain values

by Anonymous Monk
on Jun 20, 2013 at 07:54 UTC ( #1039912=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    tie my $state, 'Scalar::Restrict', qw/ idle waiting active /;
    # or maybe
    lock_scalar my $state, qw/ idle waiting active /;
    
    # $state may now only be "idle", "waiting", or "active"
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1039912]
Approved by kcott
Front-paged by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-07-04 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls