Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 (Monsignor) 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 scrutinizing the Monastery: (7)
As of 2014-08-02 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls