From 63bfca455098588d6283c6105813307e3523e5b7 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Fri, 5 Sep 1997 00:00:00 +0000 Subject: [x] FileHandle.pm fails if Exporter has not been loaded previously I just found out that FileHandle.pm doesn't work if I don't "use" an exporter module before it: % perl -MFileHandle -e "print $^O" Bareword "Exporter::export" not allowed while "strict subs" in use at I:\Perl\lib/FileHandle.pm line 80. String found where operator expected at I:\Perl\lib/FileHandle.pm line 80, near "Exporter::export 'Fcntl'" (Do you need to predeclare Exporter::export?) syntax error at I:\Perl\lib/FileHandle.pm line 80, near "Exporter::export 'Fcntl'" BEGIN failed--compilation aborted. % perl -MExporter -MFileHandle -e "print $^O" MSWin32 This is with Perl5.004_04 trial 3 on WinNT., but it doesn't look like a new problem. -Jan p5p-msgid: 3445e05b.17874041@smtp2.ibm.net -> not --- lib/FileHandle.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/FileHandle.pm') diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm index 0264b61f15..455fc63917 100644 --- a/lib/FileHandle.pm +++ b/lib/FileHandle.pm @@ -69,7 +69,8 @@ import IO::Handle grep { !defined(&$_) } @EXPORT, @EXPORT_OK; sub import { my $pkg = shift; my $callpkg = caller; - Exporter::export $pkg, $callpkg, @_; + require Exporter; + Exporter::export($pkg, $callpkg, @_); # # If the Fcntl extension is available, @@ -77,7 +78,7 @@ sub import { # eval { require Fcntl; - Exporter::export 'Fcntl', $callpkg; + Exporter::export('Fcntl', $callpkg); }; } -- cgit v1.2.1