in reply to What's your programming style?
It's been years since I wrote Perl targeting Windows systems, but I seem to recall that there is no need, when dealing with paths from within Perl code, to differentiate between Windows and Linux flavor path separators. Indeed perlport has this to say:
DOS, OS/2, VMS, VOS, and Windows can work similarly to Unix with / as path separator, or in their own idiosyncratic ways (such as having several root directories and various "unrooted" device files such NIL: and LPT:).
When in doubt it's best to use a module known for its ability to bridge these sorts of gaps. Modules like Path::Tiny, File::Basename, File::Spec (or File::Spec::Functions), and so on. Used with a little care they can take the need for most OS-specific code in your primary codebases, and where they fall short, you should probably modularize your own solutions so that primary business logic is not peppered with OS-specific cruft.
As for programming style, verbosity is not one of the virtues of a programmer. ....although you wouldn't know that by reading one of my wordy posts. ;)
Dave
|
---|