#! perl -w use strict; $|++; sub test { my ($dir) = @_; print "test $dir\n"; opendir DIR, $dir or die "can't open"; my @items = readdir DIR; closedir DIR; print " @items\n"; } test "."; # OK, reads the current directory test "/"; # OK, reads the root of the curent drive test "h:/"; # OK, reads h:/ test "c:/"; # OK, reads c:/ test "h:"; # BAD, reads the current directory when script in h:/somedir # BUT OK, reads h:/ when script in c:/somedir test "c:"; # BAD, reads the current directory when script in c:/somedir # BUT OK, reads c:/ when script in h:/somedir __END__