summaryrefslogtreecommitdiff
path: root/lib/FileHandle.pm
diff options
context:
space:
mode:
authorJan Dubois <jan.dubois@ibm.net>1997-09-05 00:00:00 +0000
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-09-05 00:00:00 +0000
commit63bfca455098588d6283c6105813307e3523e5b7 (patch)
treeddac0fcaee14ce90a98e7151e5630565afbd3db4 /lib/FileHandle.pm
parent1748e8dd6b8c191183a3274a47dc445791b196e8 (diff)
downloadperl-63bfca455098588d6283c6105813307e3523e5b7.tar.gz
[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
Diffstat (limited to 'lib/FileHandle.pm')
-rw-r--r--lib/FileHandle.pm5
1 files changed, 3 insertions, 2 deletions
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);
};
}