Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Why this error instead of doing simple break

by abdan (Acolyte)
on Nov 11, 2021 at 07:50 UTC ( [id://11138723]=perlquestion: print w/replies, xml ) Need Help??

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 (Priest) on Nov 12, 2021 at 16:16 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11138723]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found