(posted by request from chatterbox)
Yes, it works the same on Win2k. Of course, it will assume the root on the current drive letter, though (use chdir to change drive letters).
Here's an example to illustrate the point:
#!perl -w
use strict; # always
open(F,">/temp/foo.txt")
or die "Unable to open temp file for write: $!\n";
print F "This is a test. This is only a test.\n";
close(F);
open(F,"/temp/foo.txt")
or die "Unable to open temp file for read: $!\n";
while (<F>) { print "foo: $_"; }
close(F);
unlink ("/temp/foo.txt");
...which outputs:
foo: This is a test. This is only a test.
Cheers,
Shendal
|