John W.Krahn <[EMAIL PROTECTED]> writes:

[...]

>> I was reading lines with a while loop inside find() so used a `last'
>> to break out of it.  Perl gives a warning for that so I thought maybe
>> it wasn't such a good idea... but finally resorted to sticking with
>> the last and quieting the warnings with `no warnings' locally.
>
> Perl will not warn when using 'last' (or 'next' or 'redo') inside a 
> while loop so either you used it outside the loop or you used it with 
> the while statement modifier.

Ha... and right you are.  It is after the while loop so breaking out
of the find subroutine.  Which does invoke a warning.

[...]

Thanks for the answeres..

>
>> 2) What is the best way to break out of a while loop early, inside a
>>    find()?

I guess that should have been:
 
  What is the best way to break out of a subroutine early?  And I
  think you may have answered that earlier in respone to a question
  about the use of `return'.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to