develooper Front page | perl.perl5.porters | Postings from February 2000

Re: [PATCH 5.5.660] double EXPORT_OK in h2xs

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
February 24, 2000 05:44
Subject:
Re: [PATCH 5.5.660] double EXPORT_OK in h2xs
Message ID:
12548.951399865@chthon
>h2xs generates a .pm file with 'our @EXPORT_OK;' and, later,
>"our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );". This patch removes
>the initial declaration.

>(I'm assuming the array doesn't need to be predeclared before the
>'require Exporter;' - if it does, the 'our' should be removed from
>the second use instead.)

Seems like a prudent application of -w would catch whatever's going
on here.

    % perl -we 'our $x = 10; our $x = 20'
    "our" variable $x masks earlier declaration in same scope at -e line 1.

    % perl -we 'our $x = 10; {our $x = 20}'
    "our" variable $x redeclared at -e line 1.
    (Did you mean "local" instead of "our"?)

--tom

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