From: Jan Dubois Date: Fri, 5 Sep 1997 00:00:00 +0000 (+0000) Subject: [x] FileHandle.pm fails if Exporter has not been loaded previously X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63bfca455098588d6283c6105813307e3523e5b7;p=p5sagit%2Fp5-mst-13.2.git [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 --- diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm index 0264b61..455fc63 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); }; }