Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Compatibility on Win32 and UNIX

by atopolc (Pilgrim)
on May 10, 2002 at 16:04 UTC ( [id://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 (http://martynov.org/)

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found