Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Restricting a scalar to certain values

by Anonymous Monk
on Jun 20, 2013 at 07:54 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-18 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found