develooper Front page | perl.perl5.porters | Postings from July 2008

[perl #56954] This seems to be fixed in Perl 5.10

From:
=?ISO-8859-1?Q?Ren=E9e_B=E4cker?=
Date:
July 21, 2008 00:49
Subject:
[perl #56954] This seems to be fixed in Perl 5.10
Message ID:
48843F6F.1050406@smart-websolutions.de
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@smart-websolutions.de

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




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