http://qs1969.pair.com?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.