On Wed, 5 Dec 2001, Purshottam Chandak wrote:

> i was trying to work it out, for any kind of array.
> the following pseudo code doesn't seem to work
>
> for(.....) {
> if(...) {
> ..........
> }
> else {
> ........
> break;
> }
> }
>
> the break statement is not working. Even when it comes into  the else part,
> it doesn't break the for loop.
>
> Suggestions?

Perl doesn't have a break statement.  You want to use 'last':

for(@somearray) {

        if($something) {

        } else { last }
}

perldoc -f last

-- Brett
                                         http://www.chapelperilous.net/
------------------------------------------------------------------------
You can do very well in speculation where land or anything to do with dirt
is concerned.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to