Hi;

>>   The reason one should use File::Basename and File::Spec is that you
>> can become platform-independent instead of Windoze-worshipping :-)
>
> What does the operating system have to do with this?
>
> OP asked how to split a string, I gave an example how to do it character by
> character.

My understanding was that the OP wanted to split a path into
components using split which I thought was a problem already solved by
File::Spec and File::Basename and also provided platform independence;
and I thought your example showed a possible problem when splitting
using slash one could end up with individual characters which is not
at all what I thought the OP was after.

   The split function does split on the separator for path components,
but I thought File::Spec and File::Basename would be clearer (more
maintainable) and would be platform independent.

> Another example:
>
> ruud$ perl -wle '
> print for split /([aeiou])/, q{F:\test\test123\test1233}'
>
> F:\t
> e
> st\t
> e
> st123\t
> e
> st1233
>
> --
> Ruud

Ken

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to