Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
XP is just a number
 
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 taking refuge in the Monastery: (6)
As of 2014-04-23 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (553 votes), past polls