Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 ( [id://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?

Replies are listed 'Best First'.
Re^2: How do I restrict a variable to a range of values?
by salva (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://478636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-25 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found