in reply to Re: Perl/Unix case
in thread Perl/Unix case
a set of if...elsif...else statements which does essentially the same thingIt's almost the same. From what I recall of C programming, that language implements switches with jump i.e. it knows where in memory to find the code it needs to execute. This is akin to the hash solution that you mention. I've seen perl core dump on a program with too large a block of if..elsif..elsif... . That was a couple of years ago, but either way, I think that the dispatch table is the better solution for more reasons than just that.
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
|
|---|