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

Re: [PATCH 5.5.660] double EXPORT_OK in h2xs

Thread Previous | Thread Next
Tom Christiansen
February 24, 2000 05:44
Re: [PATCH 5.5.660] double EXPORT_OK in h2xs
Message ID:
>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"?)


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About