in reply to Splitting blunder
I always run to modules when I have regexp problems:
It does what you want, but without splitting. I don't know if that's acceptable for you.#!/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"}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Splitting blunder
by helmex (Initiate) on Apr 08, 2002 at 23:26 UTC |
In Section
Seekers of Perl Wisdom