From 2b0ebd1fa6ed628f8df57944f30a65f303c483e5 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Fri, 9 Aug 2002 18:44:07 +0000 Subject: fixed loadO when getFile is not used (local files). --- perl-install/install_any.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'perl-install/install_any.pm') diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index bbc6c11ae..d2f1c2496 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -876,7 +876,8 @@ sub loadO { } else { -e "$f.pl" and $f .= ".pl" unless -e $f; - my $fh = -e $f ? do { local *F; open F, $f; *F } : getFile($f) or die _("Error reading file %s", $f); + local *F; #- keep it outside the following do else filehandle will be closed before reading. + my $fh = -e $f ? do { open F, $f; *F } : getFile($f) or die _("Error reading file %s", $f); { local $/ = "\0"; no strict; @@ -884,9 +885,10 @@ sub loadO { close $fh; $@ and die; } - add2hash_($o ||= {}, $O); + $O and add2hash_($o ||= {}, $O); } - bless $o, ref $O; + $O and bless $o, ref $O; + $o; } sub generate_automatic_stage1_params { -- cgit v1.2.1