Oh my, oh my.. I beg for a pardon, but would you please consider first answering this question:
WHY do you need to use the typeglob and what good does it do in your particular example!? Remove the useless '*$' parameter that you are passing to a bunch of 'foo#' subroutines and the code should still print out the same exact stuff! To begin with, you don't even make any use of the passed parameter inside neither of your subroutines.
If you are attemping to play with typeglobs just because they appear to be a 'cool' thing to play with, please steer away from them. Otherwise, err... I'd like to see a piece of code of yours which indeed does make a good use of them.
Update: aseidas, happy to see that you took my question seriously and were not repulsed by it's apparent 'coldness' ;).
With regard to typeglobs, they are not entirely a bad thing. Sorry if that is how it came through from my initial reply. However, they could be easily abused, especially at the hands of an inexperienced or a novice or plain ignorant (not you, however :) perl programmer.
In responce to your point #3, I should point out that passing variables to a subroutine in Perl is rather trivial. I would suggest you read some introduction books on Perl programming to get the idea. Also, one of the replies to your initial posts includes a good & simple example for you to look at.
Cheers ;-)
_____________________
# Under Construction
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.