develooper Front page | perl.perl5.porters | Postings from July 2005

[perl #1442] Missing Label and -w

From:
Michael G Schwern via RT
Date:
July 12, 2005 19:03
Subject:
[perl #1442] Missing Label and -w
Message ID:
rt-3.0.11-1442-117091.3.77543388874308@perl.org
> [RT_System - Sun Sep 19 20:00:34 1999]:
> 
> This is with _61  ( perl -wc doesn't report any errors )
> 
> use strict;
> 
> for my $i (1..5) {
>   if ( $i == 2 ) { next Loop; }
> }

I presume you're reporting that "perl -cw" does not report the lack of a
loop label as an error?  This is correct because a loop label could be
created at run time.  Its odd but can happen.

  $label = "Loop";  
  eval qq[$label: for(1..5) { 
    foo(); 
    print "Never run" 
  }]; 

  sub foo { for (1..5) { next Loop } }

One of the facts of life living with such a dynamic language.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About