in reply to cross platform perl - how to modify $path

Determine which OS you are on using $^O within an if/else and set the separator character.
$separator = '/'; $separator = '\\' if ($^O =~ /Win/);


-THRAK
www.polarlava.com

Replies are listed 'Best First'.
Re: Re: cross platform perl - how to modify $path
by data64 (Chaplain) on Aug 21, 2001 at 01:02 UTC
    I actually thought about this, but I was not sure if the separator char is different for the different unix shells, ie: between csh and sh. I don't even want to think about zsh and other less common ones.

    data
      It's not; the seperator between directories is / on all unix systems. The shell is irrelevant.