Thanks for tweeking the code, I like how this looks over my original post. I was going for the 'C'ish look and this is much closer.
However,I am puzzled/concerned over the technique of calling into sub switch() and jumping out of it never to return. I have no idea if this is valid/acceptable in perl or not. Although it certainly appears to be OK in this example.
In other languages I have used, this is a technique I use only very carefully... being sure to manipulate the stack/etc accordingly to avoid stack problems down the road, like overflow and/or returning to oblivion at some point in the future.
Would/Could this technique bring out nasty side-effects... perhaps in larger applications or those running over extened periods of time?
Is this of any concern in Perl scripts?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.