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

Re: Restricting a scalar to certain values

by Anonymous Monk
on Jun 20, 2013 at 08:56 UTC ( #1039920=note: print w/replies, xml ) Need Help??

in reply to Restricting a scalar to certain values

Thanks jakeease and Anonymous for the feedback so far! I just thought I'd clarify: Yes, it's a bit like an enum - the thing is though that I'd like to retrofit some older scripts that already use a scalar as an enum. It'd be an advantage if I could just add a line at the top saying "restrict this scalar to this set of allowed values" to protect against future typos instead of updating every place where the scalar is used.

  • Comment on Re: Restricting a scalar to certain values

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2016-10-21 11:28 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (288 votes). Check out past polls.