Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Restricting a scalar to certain values

by tobyink (Canon)
on Jun 20, 2013 at 08:56 UTC ( [id://1039921]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
    $scalar = "foo";  # ok
    $scalar = "bar";  # ok
    $scalar = "baz";  # dies
    
  2. or download this
    use constant DEBUG => !!$ENV{DEVELOPMENT_SERVER};
    
    my $scalar;
    ttie $scalar, enum ["foo", "bar"] if DEBUG;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-19 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found