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

Re: [perl #24189] Incorrect comment in perldoc strict

Thread Previous
From:
Abigail
Date:
October 13, 2003 02:40
Subject:
Re: [perl #24189] Incorrect comment in perldoc strict
Message ID:
20031013093952.GB30549@abigail.nl
On Mon, Oct 13, 2003 at 11:16:15AM +0200, Rafael Garcia-Suarez wrote:
> Iain 'Spoon' Truskett (via RT) wrote:
> > 
> > I believe the original wording is wrong. It's talking about the wrong
> > part of the expression, or is just talking about something that's not
> > there..
> 
> I think the original wording talks about the {PIPE} part... looks OK to me.

Considering that the three lines of code all have '$SIG {PIPE}', and
the subsection is about strict *subs*, I would find it highly 
confusing that the second of the three line is talking about the
$SIG {PIPE} part, and the first and third about the Plumber part.

I agree that the original comment isn't wrong, but it's far from optimal.
Iain's patch make a lot of sense to me.

> > --- lib/strict.pm~	2003-10-12 18:52:02.000000000 +1000
> > +++ lib/strict.pm	2003-10-12 18:54:58.000000000 +1000
> > @@ -108,21 +108,21 @@
> >  
> >  =item C<strict subs>
> >  
> >  This disables the poetry optimization, generating a compile-time error if
> >  you try to use a bareword identifier that's not a subroutine, unless it
> >  is a simple identifier (no colons) and that it appears in curly braces or
> >  on the left hand side of the C<< => >> symbol.
> >  
> >      use strict 'subs';
> >      $SIG{PIPE} = Plumber;   	# blows up
> > -    $SIG{PIPE} = "Plumber"; 	# just fine: bareword in curlies always 
> > +    $SIG{PIPE} = "Plumber"; 	# just fine: quoted string is always ok
> >      $SIG{PIPE} = \&Plumber; 	# preferred form


Abigail

Thread Previous


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