on 07/12/2001 01:59 AM, Nobumi Iyanaga at [EMAIL PROTECTED] wrote:
> Hello,
>
> I am writing some scripts for cross-platform use. How can I determine the
> OS on which a script is running? If it is a Mac, I will use ":" as
> directory separator; if it is a Windows, I will use "\\", and if it is a
> Unix, I will use "/".
use vars qw/$DS/;
if ($^O eq 'MacOS') {
$DS = ':';
} else {
$DS = '/';
}
is a simple way to do it for mac/unix, and there are other tests you can do
for windows as well.
perldoc perlvar
--
Scott R. Godin | e-mail : [EMAIL PROTECTED]
Laughing Dragon Services | web : http://www.webdragon.net/