in reply to filtering folder path using regex.

Another non-regex way to get this data is.
use strict; my $path = shift; my($drive, $top) = ( split('\', $path) )[0,1];
Im note sure if the split arg there should be \, or \\.

MMMMM... Chocolaty Perl Goodness.....

Replies are listed 'Best First'.
Re: Re: filtering folder path using regex.
by blackadder (Hermit) on Jul 14, 2003 at 08:23 UTC
    O' this is neat, I did think about split and splice to start off with, but then I went the Regex way!. Thanks brethren.

    I have found many Regex and pattern matching related tutorials on this site. Which all made a nice read over the very warm weekend.Anyway...

    God blesses.