R
Ronald Fischer
The program
#!/usr/bin/perl -w
use strict;
if(1)
{
last;
}
when run under perl 5.8, raises the error
Can't "last" outside a loop block at ./lasttest.pl line 5.
Note that 'man perlsyn' says:
"A BLOCK by itself (labeled or not) is semantically
equivalent to a loop that executes once. Thus you can
use any of the loop control statements in it to leave
or restart the block."
So my example above should be legal....
Ronald
#!/usr/bin/perl -w
use strict;
if(1)
{
last;
}
when run under perl 5.8, raises the error
Can't "last" outside a loop block at ./lasttest.pl line 5.
Note that 'man perlsyn' says:
"A BLOCK by itself (labeled or not) is semantically
equivalent to a loop that executes once. Thus you can
use any of the loop control statements in it to leave
or restart the block."
So my example above should be legal....
Ronald