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
From:
James E Keenan via RT
Date:
May 3, 2012 19:15
Subject:
[perl #43400] "use Module my $var" doesn't declare $var properly
Message ID:
rt-3.6.HEAD-4610-1336097734-930.43400-15-0@perl.org
On Wed Jun 27 13:00:57 2007, jsailor wrote:
> 
> This is a bug report for perl from jsailor@jesnetplus.com,
> 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
https://rt.perl.org:443/rt3/Ticket/Display.html?id=43400

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