Yes.
Copy the code you posted in your original question (aka OP, "Original Post", not to be confused... er, well, often confused because ambiguous with "Original Poster") and compare it, letter-by-letter, punct-by-punct; and space-by-space, if necessary, with the code that's giving you the problem. Doing so will reveal your typo.
Then correct it or paste what you copied over your original code; add use strict; use warnings (not needed with 5.16 and higher update: if the script includes the line use 5.01n; where n is a relevant decimal digit) at the top, just after the hashbang. Voila; all should run as you expected, originally.
Hint: when posting, copy and paste rather than retype. Doing so will save you the pain of discovering later that you've corrected an error or created a new one by retyping.
If you didn't program your executable by toggling in binary, it wasn't really programming!
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.