To allow for labels you need to block off the code(because I assume you don't wish it for the entire script; but if you did, you still need brackets). This would work for our example:
LINE: { flock(FILE,2) or goto LINE; } #p.s., you should probably
#use the constants provided
#and not numbers like 2
Update: Yes, labels on single lines can be used. However, in practise, a looping construct(for,while,etc.) is usually better for only a single line. Even then, though, having brackets is best to solve any abiguity that may arise. But yes, a single line label is possible(and useful on some occasions).
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.