Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Avoiding if/else knots

by xdg (Monsignor)
on Aug 18, 2006 at 14:28 UTC ( [id://568164]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Avoiding if/else knots
in thread Avoiding if/else knots

No offense, but you really haven't added anything to what I said.

Well, we can agree to disagree.

You said 'if you want any value in the range 1-999' but then said 'each of those integers'. Those aren't the same thing. My post was an attempt to differentiate the easy case (integers) from the hard case (non-integers).

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^5: Avoiding if/else knots
by Limbic~Region (Chancellor) on Aug 18, 2006 at 15:17 UTC
    xdg,
    Yes, we can agree to disagree. My opinion is that we are talking past each other and you are countering a position I don't hold. Update You are correct that I did make a typo s/value/integer/ - it definately does change the meaning of the sentence.</Update>

    My example was to illustrate that a simple question such as "is the integer in this range" can't be answered with a single key in the dispatch table. This immediately followed my first assertion that the problem was each condition had to be an exact key. It was a simple example that illustrated the point.

    I didn't bother moving on to more complex examples because I believe I had already made my point and because I referenced Roy Johnson's great tutorial - Implementing Dispatch Tables which covers these difficult cases and some work arounds.

    Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found