develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #21396] documentation error in subs.pm

From:
juerd
Date:
March 28, 2003 00:46
Subject:
Re: [perl #21396] documentation error in subs.pm
Message ID:
20030328064557.GH7491@c3.convolution.nl
On Thu, Mar 27, 2003 at 11:40:42PM -0000, Yitzchak Scott-Thoennes wrote:
> On 27 Feb 2003 23:31:17 -0000, Juerd wrote:
> >"They are thus effective for the entire file in which they appear."
> >That should be entire *package*, not file.
> The paragraph in question is this:
>   Unlike pragmas that affect the C<$^H> hints variable, the C<use vars> and
>   C<use subs> declarations are not BLOCK-scoped.  They are thus effective
>   for the entire file in which they appear.  You may not rescind such
>   declarations with C<no vars> or C<no subs>.
> (An almost identical paragraph is in vars.pm.)
> Changing it to say package doesn't help, since the effect is no more
> limited to the package C<use> appears in than to the block:
> { package Foo; use subs 'Bar::bar'; }  print STDOUT Bar::bar;
> Do you have an another suggestion for how to change the wording?

Those are Foo::Bar::bar and Bar::bar.

Bar::bar here, if not defined as a sub (which it is not, because the
pragma only uses Foo::Bar::bar), is an unquoted bareword, as strict
complains:

Bareword "Bar::bar" not allowed while "strict subs" in use at -e line 1.


Juerd



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