Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: writtings files to a new folder

by rinceWind (Monsignor)
on Jan 24, 2007 at 09:36 UTC ( [id://596224]=note: print w/replies, xml ) Need Help??


in reply to Re: writtings files to a new folder
in thread writtings files to a new folder

Also, I've assumed "/" is a correct filepath separator and in most cases it is, but if you want to write really portable code you'll want to look into File::Spec.

That's not the complete picture, as non-Unix operating systems support POSIX syntax (i.e. Unix) besides their own native syntax. All operating systems that run perl support POSIX syntax, otherwise the perl build process wouldn't work. For a bizarre native syntax, have a look at VMS. There can be problems if you try and mix native and POSIX, though sometimes in Windows, you can get away with a mixture of slashes leaning both ways.

My advice is to either stick to native syntax, with File::Spec and friends, or use POSIX syntax throughout. Beware that a user supplied filename might contain native syntax elements.

For more on this, and portability in general, please refer to my talk slides - I have given this talk at several YAPCs.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found