Before File::Spec, this is what I used. It still works today and it worked on very old perls on every Unix-like and Windows platforms that I've ever encountered.
Basically, the idea is to ask perl what it uses as directory separator char.
Sample use ($dirSep gets either back or forward slash character):
$dirSep = ( $ENV{"PATH"} =~ m/;[a-z]:\\/i ) ? '\\' : '/' ; print $dirSep;
In reply to Re: Platform independant directory separator
by alg
in thread Platform independant directory separator
by jaa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |