Two things: Do you really know that your if statement is succeeding? When you have doubts about things like that, putting a print, die(), or some other statement that removes the question of whether your subroutine is actually getting called is needed.
The second thing is the ampersand really isn't needed in the context that you're calling msg(). Typically, when you're passing arguments to a subroutine, the ampersand is not used. It's used when you want to pass the current value of @_ to the subroutine.
I ran your code, setting $proto = "HTTP/1.0", and then to "xHTTP/1.0". In both cases, it ran fine. This leads me to believe that the value that you think should be in $proto is not what you expect. To test your theory, put a print or die() statement after the if that will display the value of $proto.
--Chris
e-mail jcwren
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.