Document that File::Find doesn't follow symlinks
[p5sagit/p5-mst-13.2.git] / lib / FileHandle.pm
index b907cae..455fc63 100644 (file)
@@ -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);
     };
 }
 
@@ -93,6 +94,11 @@ sub pipe {
     ($r, $w);
 }
 
+# Rebless standard file handles
+bless *STDIN{IO},  "FileHandle" if ref *STDIN{IO}  eq "IO::Handle";
+bless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle";
+bless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle";
+
 1;
 
 __END__
@@ -130,7 +136,7 @@ FileHandle - supply object methods for filehandles
     }
 
     $pos = $fh->getpos;
-    $fh->setpos $pos;
+    $fh->setpos($pos);
 
     $fh->setvbuf($buffer_var, _IOLBF, 1024);