Rewind dir : telldir « File « Perl






Rewind dir

    


#! /usr/local/bin/perl
use Cwd;
$dir = cwd;
print "dir=> $dir\n";

opendir(THISDIR, "$dir");
@dirList = <THISDIR>;
print "OPEN @dirList\n";

$loc = telldir THISDIR;
print "Before Rewind Loc ==> $loc\n";

rewinddir THISDIR;
$loc = telldir THISDIR;
print "After Rewind Loc ==> $loc\n";
rewinddir THISDIR;

   
    
    
    
  








Related examples in the same category

1.telldir and readdir
2.Calculating Byte Offsets with telldir