> I have a subroutine "splitFilename" that I wrote that does this for
> me.  It's been enhanced over time to include support for UNC, but this
> is the meat of that subroutine that handles directory/path/filename
> strings:

Not to be a wet blanket, but isn't File::Basename part of the core? I
looked in Basename.pm and file/directory name parsing has been somewhat
standardized in Perl since 1996.

> ($file_d, $file_p_tl, $file_p, $file_f, $file_e) = m#^[\\/][\\/]#
>     ? m#^([\\/][\\/][^\\/]+[\\/]) (([\\/][^\\/]+)*[\\/]) (.*?)
> ((\.[^.]+)*)$#x
>     : m#^([a-z]:) (([\\/][^\\/]+)*[\\/]) (.*?) ((\.[^.]+)*)$#ix;

Not having looked at that in too much detail, Basename.pm basically
gives this for Win32 systems:

 ($dirpath,$basename) = (/^(.*[:>\]])?(.*)/s)
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to