Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Compatibility on Win32 and UNIX

by atopolc (Pilgrim)
on May 10, 2002 at 16:04 UTC ( #165680=note: print w/replies, xml ) Need Help??

in reply to Compatibility on Win32 and UNIX

You could check the  $^O variable and switch the path format depending on the result.

$^O eq "hpux" ? $path='/path/thisway':$path='\path\thisway';

Replies are listed 'Best First'.
Re: Re: Compatibility on Win32 and UNIX
by IlyaM (Parson) on May 10, 2002 at 16:42 UTC
    Don't do it. It is ugly. Just use File::Spec. Let perl hackers who maintain this module worry which slash to use on which platform.
    use File::Spec; $path = File::Spec->catfile('path', 'thisway');

    Ilya Martynov (

      Thanks and appreciations go to all of you. Have a good weekend.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://165680]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2021-12-05 09:32 GMT
Find Nodes?
    Voting Booth?
    R or B?

    Results (31 votes). Check out past polls.