http://www.perlmonks.org?node_id=157521


in reply to Splitting blunder

I always run to modules when I have regexp problems:

#!/usr/bin/perl -w use strict; use File::Basename; my $fullpath = '\\Server\dir\user'; my $popped; my @fileparts; while($fullpath ne "" && ($popped = basename($fullpath)) ) { push @fileparts, $popped; $fullpath = dirname($fullpath); } for(@fileparts) {print "$_\n"}
It does what you want, but without splitting. I don't know if that's acceptable for you.


Replies are listed 'Best First'.
Re: Re: Splitting blunder
by helmex (Initiate) on Apr 08, 2002 at 23:26 UTC
    Thanks for all the leads.
    TYPO - I did escape the backslashes, posted wrong sorry
    %^+^%