Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: writtings files to a new folderby rinceWind (Monsignor) |
on Jan 24, 2007 at 09:36 UTC ( [id://596224]=note: print w/replies, xml ) | Need Help?? |
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. --
In Section
Seekers of Perl Wisdom
|
|