[vox-tech] perl question: how to detect operating system?

Mark K. Kim vox-tech@lists.lugod.org
Tue, 25 Dec 2001 22:16:34 -0800 (PST)


On Mon, 24 Dec 2001, Rod Roark wrote:

> > also, when a perl script makes use of a pathname under windows, say,
> >
> > 	open(FP, "/directory/file") or die "Can't open file";
> >
> > do i use `/' or `\'?
>
> Probably something like "c:\\directory\\file".

The DOS/Windows kernel understands forward slashes so 'c:/directory/file'
should be fine (or just '/directory/file' if you just wanna use the CWD).
But do test to see if it works first, though.

-Mark

--
Mark K. Kim
http://www.cbreak.org/mark/
PGP key available upon request.