Perl Labeled blocks - Perl Views : 115
Tagged in : Perl
0 0
Send mail

Perl Labeled blocks


Labeled blocks work similiar to 'goto' in other languages. It is recommended that the label name is in all upper case and only use letters or numbers. Also use a name that isn't or won't ever be used as reserved word, i.e. 'print' would not be a legal name to use for label. The name is always followed by a colon.

SOMELABEL: while (condition) {
statements;
if (somethingelse) {
otherstatements;
last SOMELABEL;
}
}
By Geethalakshmi, On - 2010-09-17



    Login to add Comments .