Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Cross platform compatability Part 1: Shells and Files

by ok (Beadle)
on Jan 25, 2001 at 04:20 UTC ( [id://54167]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Cross platform compatability Part 1: Shells and Files
in thread Cross platform compatability Part 1: Shells and Files

Unless, of course, you're on a Mac (where the directory separator is ':'), or some other operating system with a different directory separator. :)

If you're really worried about the directory separator, do this:

$dir_separator='/'; open BLARG, "$dir_name$dir_separator$file_name";

I can't really explain why, but sticking directory separators in a file name makes me cringe. I guess it's because the separator is not a part of the file name.

There, I guess I did explain why.

Replies are listed 'Best First'.
Re: Re: Re: Re: Cross platform compatability Part 1: Shells and Files
by tye (Sage) on Jan 25, 2001 at 04:54 UTC

    Sorry, not all platforms even use directory separators in that manner. Take a look at File::Spec for the proper way to do this portably.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (8)
As of 2024-04-18 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found