The prototype problem is probably because you didn't have just
\&foo, rather something like
\&foo(), in which case the subroutine foo would have been run, which would result in prototype mismatch. However, if you leave out the parentheses completely no subroutine call will be made and such no prototype check will occure there. If you do like
Juerd and
rinceWind said then you're home safe. You must realize that
& is the sigil of subroutines, just like
$ is the sigil of scalars. So you use
& to address it, not call it. If you want to execute the subroutine then you use parentheses, but not otherwise.
(Disclaimer to other monks: Yes, I know this is very simplified and I know about
&foo and it's magical
@_ treatment, but that's another issue and let's not confuse he who seeks help with almost irrelevant details.)
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.