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

Rod Roark vox-tech@lists.lugod.org
Mon, 24 Dec 2001 10:10:27 -0800


On Monday 24 December 2001 08:22 am, Peter Jay Salzman wrote:
> in perl, how does one go about detecting what operating system the
> program is running under?

Try "$^O".

> 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".

-- Rod