abdan has asked for the wisdom of the Perl Monks concerning the following question:

Can't "break" outside a given block at (eval 9)[/usr/share/perl5/core_perl/perl5db.pl:741] line 2, <H> line 9. why this error message show when it's supposed to break
DB<7> open H,'E.LIB'; while(<H>){ print '='.$_; if($_ =~ /^\*\h*moto +r/i){ break;} };close H;
Please clarify

Replies are listed 'Best First'.
Re: Why this error instead of doing simple break
by LanX (Saint) on Nov 11, 2021 at 08:15 UTC
Re: Why this error instead of doing simple break
by Discipulus (Canon) on Nov 11, 2021 at 11:47 UTC
    > Can't "break" outside a given block

    should be:

    > Can't "break" outside a "given" block

    L*

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Re: Why this error instead of doing simple break
by ForgotPasswordAgain (Vicar) on Nov 12, 2021 at 16:16 UTC