perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: svn commit: r202272 - /perl/modperl/trunk/t/apache/content_length_header.t
Date Tue, 28 Jun 2005 20:24:21 GMT

> Isn't it an error to write an "if" on a "my" (variable declaration line)
> like the above

the "error" you're talking about is the

  my $x if 0;

ism that causes localization problems in some instances.

http://perl.com/pub/a/2000/05/p5pdigest/THISWEEK-20000521.html#my_x_if_0;_Trick

I doubt it would cause problems in this case since the variable in
question is examined only once - there are no future invocations where
it might collide.

but maybe it's bad form nonetheless.  'our' scope is probably sufficient
in addition to the fix you suggest, but only if it's really bugging you :)

--Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Mime
View raw message