Bug#722448: now for() items are getting zapped by unrelated file opens
Damyan Ivanov
dmn at debian.org
Wed Sep 11 07:58:43 UTC 2013
-=| jidanni at jidanni.org, 11.09.2013 14:59:42 +0800 |=-
> Package: perl
> Version: 5.18.1-3
> Severity: wishlist
>
> Unbelievable. As of today this zaps the innocent for() item!
>
> my @ARGZ = ( "xCOUCH", "VAL" );
> print Dumper(@ARGZ);
> for ( $ARGZ[0] ) {
> if (/^xCOUCH$/) {
> my $p = youtube_info(99);
> }
> }
> die Dumper(@ARGZ);
> sub youtube_info {
>
> open( my $in, "<", "/dev/null" ) or die "Can't open YT DB: $!";
> while (<$in>) {
This <$in> uses the global $_ variable, overwriting anything aliased
to it. No bug here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/perl-maintainers/attachments/20130911/0f9dbdc6/attachment.sig>
More information about the Perl-maintainers
mailing list