in reply to unused labels should not halt compilation

(Update)You can only add a label to a blockYou can't add a label to use, so line numbering everything is out of the question.

Why on earth do you want line numbers? goto LABEL is bad, and if you feel line numbers are the ultimate way of structuring your code, maybe a nice tutorial can make you think clear again.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

  • Comment on Re: unused labels should not halt compilation

Replies are listed 'Best First'.
Re: Re: unused labels should not halt compilation
by Anonymous Monk on May 27, 2002 at 22:13 UTC
    a smidgen of creative blocking lets you number use as well.
    #!/usr/bin/perl -w L000: { use strict; L001: {use Quantum::Superpositions} L002: my $foo = all(1,2,3); L003: $foo *= 2; L004: print "Here I am\n"; L005: goto L003 unless all($foo) > 10; L006: print "$foo"; L007: }
Re: Re: unused labels should not halt compilation
by Anonymous Monk on May 27, 2002 at 21:09 UTC
    Funny, this runs perfectly fine with my Perl 5.6.1
    #!/usr/bin/perl -w use strict; L000: my $i = 1; L001: print "Here I am\n"; L002: goto L001 unless $i++ > 10; L003: print "Done\n";
    and nary a block in sight