Duffy, Peter <> wrote:
> Hi Brian,
> 
> Thanks very much for that. Apologies for missing the \s and \t - I
> should have spotted those: I take your point about using "strict" and
> "warnings". Almost immediately after sending the original post, I
> noticed that I'd used double-quotes and tried replacing them with   
> single-quotes: however, in this case, splitpath put the entire path
> into the $filename slot. 
> 
> I did see the bit in the doc about $volume being set to '' in systems
> with no concept of a volume. However, my assumption was that, in my
> example, splitpath would ignore the "T:" and split the rest into path
> and filename. Basically, given that this module is allegedly to
> assist with portability across platforms, I would have thought that
> the parsing would be identical on all platforms, and be comprehensive
> enough to recognise all supported formats: only the output would be
> in terms of the current platform. There doesn't seem to be a lot of
> point in each platform-specific submodule only being able to
> recognise the format native to that platform.         

The trouble with that is that it is not possible, in general, to parse a
path string without knowing its platform. In your example, the
characters ":" and "\" are not path separators on Linux, but they are
valid as part of a path element. File::Spec simply tries to provide a
(mostly) platform independent interface to an underlying platform
specific implementation.

You might get better results if you used a more platform independent
path string, for instance "/" is a valid path separator on both Linux
and win32, but how would you expect your script to make sense of Win32
path names on Linux, and vice versa?

HTH

-- 
Brian Raven 

-----------------------------------------------------------------------------------------------------------
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient or have received this e-mail in error, please advise 
the sender immediately by reply e-mail and delete this message and any 
attachments without retaining a copy. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.


_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to