Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How do I restrict a variable to a range of values?

by bofh_of_oz (Hermit)
on Jul 27, 2005 at 15:17 UTC ( #478636=note: print w/ replies, xml ) Need Help??


in reply to How do I restrict a variable to a range of values?

In two words: you don't.

In many more words: You can't restrict a variable from having any value it gets assigned. You can, however, write a validation block to check for valid values and complain|die|ignore the rest. I believe that's how it's being done in most cases...

--------------------------------
An idea is not responsible for the people who believe in it...


Comment on Re: How do I restrict a variable to a range of values?
Re^2: How do I restrict a variable to a range of values?
by salva (Abbot) on Jul 27, 2005 at 15:37 UTC
    You can't restrict a variable from having any value it gets assigned.

    yes you can, using tie or at a lower level XS magic.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2015-07-05 21:35 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 (68 votes), past polls