develooper Front page | perl.perl5.porters | Postings from April 2010

Re: package block syntax

Thread Previous | Thread Next
From:
=?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?=
Date:
April 28, 2010 02:15
Subject:
Re: package block syntax
Message ID:
r2z51dd1af81004280215g682c3047t83228f14c2b161f0@mail.gmail.com
On Wed, Apr 28, 2010 at 08:53, Zefram <zefram@fysh.org> wrote:
>>goto inside/out of package: works:
>
> Well of course it works: it's got the same op tree as for a bare "{
> ... }" block.  Inward goto is deprecated, of course.

This:

    goto label;
    package Boo {
      label:
        print "moo";
    }

Gets deparsed to:

    goto label;
    {
        label: package Boo;
        print 'moo';
    }

Should it be putting the label before the package declaration? Will
that break anything?

    goto label;
    {
        package Boo;
        label:
        print 'moo';
    }

It also looks like Deparse hasn't been updated to work package PACKAGE
VERSION for either the new syntax or the old:

    $ ./perl -Ilib -MO=Deparse -e 'package Foo 0.10; package Bar 0.10
{ print "moo" }'
    package Foo;
    {
        package Bar;
        print 'moo';
    }

Thread Previous | Thread Next


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