I gather you are running this on a unix or linux box of some sort. In terms of posting code for monks to look at, you might try running this shell command, and just post the stuff that gets printed to your terminal as a result:
perl -ne 'print unless /^\s*#/' your_script_file
That removes all comments and lines that are commented out. (It also removes the initial "shebang" line, but we don't need to see that anyway.)
I was going to suggest there might be a problem here:
open (PASSWDFILE, "//etc//passwd");
but then I remembered that the OS will automatically ignore repeated slashes in file path strings. Still, you don't need to double the slashes (it's the backslash that needs to be doubled in order to get a literal backslash: \\). And you really should check whether the open() succeeded, even for that file; it's just a good habit.
Welcome to the Monastery!
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.