This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
modernize mkppport with signatures
[perl5.git] / lib / FileHandle.pm
index cd80d19..133221b 100644 (file)
@@ -1,10 +1,10 @@
 package FileHandle;
 
-use 5.005_64;
+use 5.006;
 use strict;
 our($VERSION, @ISA, @EXPORT, @EXPORT_OK);
 
-$VERSION = "2.00";
+$VERSION = "2.03";
 
 require IO::File;
 @ISA = qw(IO::File);
@@ -36,7 +36,7 @@ require IO::File;
 #
 # Everything we're willing to export, we must first import.
 #
-import IO::Handle grep { !defined(&$_) } @EXPORT, @EXPORT_OK;
+IO::Handle->import( grep { !defined(&$_) } @EXPORT, @EXPORT_OK );
 
 #
 # Some people call "FileHandle::function", so all the functions
@@ -88,8 +88,8 @@ sub import {
 #
 
 sub pipe {
-    my $r = new IO::Handle;
-    my $w = new IO::Handle;
+    my $r = IO::Handle->new;
+    my $w = IO::Handle->new;
     CORE::pipe($r, $w) or return undef;
     ($r, $w);
 }
@@ -111,25 +111,25 @@ FileHandle - supply object methods for filehandles
 
     use FileHandle;
 
-    $fh = new FileHandle;
+    $fh = FileHandle->new;
     if ($fh->open("< file")) {
         print <$fh>;
         $fh->close;
     }
 
-    $fh = new FileHandle "> FOO";
+    $fh = FileHandle->new("> FOO");
     if (defined $fh) {
         print $fh "bar\n";
         $fh->close;
     }
 
-    $fh = new FileHandle "file", "r";
+    $fh = FileHandle->new("file", "r");
     if (defined $fh) {
         print <$fh>;
         undef $fh;       # automatically closes the file
     }
 
-    $fh = new FileHandle "file", O_WRONLY|O_APPEND;
+    $fh = FileHandle->new("file", O_WRONLY|O_APPEND);
     if (defined $fh) {
         print $fh "corge\n";
         undef $fh;       # automatically closes the file