develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #43400] "use Module my $var" doesn't declare $var properly

Thread Previous | Thread Next
James E Keenan via RT
May 3, 2012 19:15
[perl #43400] "use Module my $var" doesn't declare $var properly
Message ID:
On Wed Jun 27 13:00:57 2007, jsailor wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.35 running under perl v5.8.8.
> -----------------------------------------------------------------
> [Please enter your report here]
> Attempting to declare a variable in a use statement does not make the
>    variable
> visible later as it should.
> For example,
>   perl -wMstrict -e 'use DirHandle my $var; print $var'
>   # DirHandle chosen simply because it does not define an import
>    method
> dies, even though the my declaration is not contained in a block or
>    eval, which
> means, according to the documentation in perlfunc for my.

I don't see any basis for believing that you can declare a variable in a
'use' statement.  'perldoc -f use' starts out like this:

       use Module VERSION LIST
       use Module VERSION
       use Module LIST
       use Module
       use VERSION

The syntax presented by the original poster satisfies none of these formats.

I propose we reject the ticket.

Thank you very much.
Jim Keenan

via perlbug:  queue: perl5 status: open

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