Hello Monks,
maybe someone can explain this behaviour to me:
I've already "played" a bit with the flock system in Perl,
and noticed, if I print an array directly everything works fine, if I print only some values it doesn't work (Lines get corrupted / wrongly printed):
flock($fh, LOCK_EX) or die "cannnot lock file - $!\n";
print $fh @out;
#print $fh $out[0]; #Date
#print $fh $out[1]; #Site
#print $fh $out[2]; #CTR
#print $fh $out[3]; #IP
#print $fh $out[4]; #Temperature
flock($fh, LOCK_UN) or die "cannnot unlock file - $!\n";
why does it behave like this? Or is flock only for the next print argument?
Thanks in advance!
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.