ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
[perl #56954] This seems to be fixed in Perl 5.10
by Renee Baecker other posts by this author
Jul 21 2008 12:49AM messages near this date
Re: [perl #57174] Recursion memory leak when assignment in if condition | podlators 2.1.2 released
With Perl 5.8.8 the error message depends on the formatting of the code 
and with Perl 5.10.0 the error message disappears:

rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ cat ../bugs/56954.pl
#!/usr/bin/perl

use strict;



sub lines_array { [$_[0] =~ /(.*\n)/g] }



my %files;



$files{"Mod1.pm"} = lines_array <<'END';

package Mod1;

sub subr {

my ($path) = @_;

open FH1, "<", $path

or die;

}

1;

END



$files{"Mod2.pm"} = lines_array <<'END';

package Mod2;

sub subr {

my ($path) = @_;

open FH2, "<", $path

or die;

}

1;

END



unshift @INC, sub {

my ($self, $path) = @_;

my $content = $files{$path};

if ($content) {

my $next = 0;

sub {

if ($next < @$content) {

$_ = $content-> [$next];

$next++;

1;

} else {

0;

}

};

}

};



require Mod1;

require Mod2;

rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $ ./perl -Ilib 
../bugs/56954.pl
rbaecker@www-devel-rbaecker ~/perl510/perl-5.10.0 $



-- 

Renée Bäcker
renee.baecker@[...].de

XING: http://www.xing.com/profile/Renee_Baecker
Foo-Magazin: http://foo-magazin.de

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved