Bump version of IO::Dir after last patch
[p5sagit/p5-mst-13.2.git] / ext / IO / lib / IO / Dir.pm
index d09eb7f..4948142 100644 (file)
@@ -6,7 +6,7 @@
 
 package IO::Dir;
 
-use 5.6.0;
+use 5.006;
 
 use strict;
 use Carp;
@@ -19,7 +19,8 @@ use File::stat;
 use File::Spec;
 
 @ISA = qw(Tie::Hash Exporter);
-$VERSION = "1.03_00";
+$VERSION = "1.06_01";
+$VERSION = eval $VERSION;
 @EXPORT_OK = qw(DIR_UNLINK);
 
 sub DIR_UNLINK () { 1 }
@@ -37,6 +38,8 @@ sub new {
 
 sub DESTROY {
     my ($dh) = @_;
+    local($., $@, $!, $^E, $?);
+    no warnings 'io';
     closedir($dh);
 }
 
@@ -128,12 +131,13 @@ sub STORE {
 
 sub DELETE {
     my($dh,$key) = @_;
-    # Only unlink if unlink-ing is enabled
-    my $file = File::Spec->catfile(${*$dh}{io_dir_path}, $key);
 
+    # Only unlink if unlink-ing is enabled
     return 0
        unless ${*$dh}{io_dir_unlink};
 
+    my $file = File::Spec->catfile(${*$dh}{io_dir_path}, $key);
+
     -d $file
        ? rmdir($file)
        : unlink($file);
@@ -150,7 +154,7 @@ IO::Dir - supply object methods for directory handles
 =head1 SYNOPSIS
 
     use IO::Dir;
-    $d = new IO::Dir ".";
+    $d = IO::Dir->new(".");
     if (defined $d) {
         while (defined($_ = $d->read)) { something($_); }
         $d->rewind;
@@ -158,7 +162,7 @@ IO::Dir - supply object methods for directory handles
         undef $d;
     }
 
-    tie %dir, IO::Dir, ".";
+    tie %dir, 'IO::Dir', ".";
     foreach (keys %dir) {
        print $_, " " , $dir{$_}->size,"\n";
     }
@@ -176,7 +180,7 @@ directory reading routines.
 
 =item new ( [ DIRNAME ] )
 
-C<new> is the constuctor for C<IO::Dir> objects. It accepts one optional
+C<new> is the constructor for C<IO::Dir> objects. It accepts one optional
 argument which,  if given, C<new> will pass to C<open>
 
 =back
@@ -201,25 +205,26 @@ for details of these functions.
 
 =back
 
-C<IO::Dir> also provides a interface to reading directories via a tied
-HASH. The tied HASH extends the interface beyond just the directory
+C<IO::Dir> also provides an interface to reading directories via a tied
+hash. The tied hash extends the interface beyond just the directory
 reading routines by the use of C<lstat>, from the C<File::stat> package,
 C<unlink>, C<rmdir> and C<utime>.
 
 =over 4
 
-=item tie %hash, IO::Dir, DIRNAME [, OPTIONS ]
+=item tie %hash, 'IO::Dir', DIRNAME [, OPTIONS ]
 
 =back
 
-The keys of the HASH will be the names of the entries in the directory. 
+The keys of the hash will be the names of the entries in the directory. 
 Reading a value from the hash will be the result of calling
-C<File::stat::lstat>. Deleting an element from the hash will call C<unlink>
-providing that C<DIR_UNLINK> is passed in the C<OPTIONS>.
+C<File::stat::lstat>.  Deleting an element from the hash will 
+delete the corresponding file or subdirectory,
+provided that C<DIR_UNLINK> is included in the C<OPTIONS>.
 
-Assigning to an entry in the HASH will cause the time stamps of the file
+Assigning to an entry in the hash will cause the time stamps of the file
 to be modified. If the file does not exist then it will be created. Assigning
-a single integer to a HASH element will cause both the access and 
+a single integer to a hash element will cause both the access and 
 modification times to be changed to that value. Alternatively a reference to
 an array of two values can be passed. The first array element will be used to
 set the access time and the second element will be used to set the modification
@@ -236,7 +241,7 @@ bugs to <perl5-porters@perl.org>.
 
 =head1 COPYRIGHT
 
-Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved.
+Copyright (c) 1997-2003 Graham Barr <gbarr@pobox.com>. All rights reserved.
 This program is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.