[EMAIL PROTECTED] wrote:

> i figure if i'm going to be a nut for efficiency might as well see it 
> split is ok with null....

So now you have to determine what each part is - before, you knew.

>   my @fldrs = split /\00/, $regval;
>   foreach $regval (@fldrs){
>     if(-f $regval){
>       &rep("Found file $regval|<-",$verb);
>       push @watch, $regval;
>     }elsif(-d $regval){
>       &rep("Found directory $regval|<-",$verb);
>       push @watch, $regval;
>     }else{ &rep("How did this get in here? val is: $regval|<-", $verb); }
>   }
> 
> then i don't need to use the match to catch the files/directories and 
> there's even an error check in the run... cuts the block down 
> tremendously, and the split takes care of both null removal and splitting 
> it up to get the files/directories at once....is PERL one of the languages 
> where the build in functions like split are optimized over pattern 
> matches?

Not sure what that means, but Perl has very fast RE evaluation.  (r)index
and substr would be faster though and do the same job in the case of a
single character RE.

-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to