How, exactly does 'print' work?
I read the relevant documentation, but can't seem to figure out what is going on with my script. I am processing a very large file, which is stored in a nested hash, which I am eventually printing out after various manipulations (ok, so that sounds very unclear, but the code is too long to post, and I'm not really interested in having my problem explicitly solved by someone else - I'd like to know a bit about the perl digestive tract). At certain points output hangs, and the print statements never get executed, however if I include an extra 'print' statement for the hash keys/values I am trying to process and print, the later keys/values which otherwise hang, print out properly. I am adding/changing nothing to the body of the script, other than this extra print statement.
So how exactly does the print statement work? Is it flushing memory/data that some poorly written code is otherwise accumulating? I'd really like to know since I've never seen this before. Thanks!
2006-08-03 Retitled by GrandFather, as per Monastery guidelines
Original title: 'print'
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.