Path: utzoo!utgpu!news-server.csri.toronto.edu!me!eastick Newsgroups: comp.lang.perl From: eastick@me.utoronto.ca (Doug Eastick) Subject: Re: an easier way? Message-ID: <90Nov4.182417est.18949@me.utoronto.ca> Organization: University of Toronto, Department of Mechanical Engineering References: <23043@fs2.NISC.SRI.COM> <10226@jpl-devvax.JPL.NASA.GOV> Distribution: comp Date: 4 Nov 90 23:24:25 GMT >(Chan Wilson [Animal]) writes: >: $file{(reverse(split(/\//,$path)))[0]}++ if ($part =~ /A1\//); Larry writes: > $file{@path = split(m#/#,$path), pop @path}++ if $part =~ m#A1/#; > ($file) = $path =~ m#.*/(.*)#; > ($file = $path) =~ s#.*/##; > $file{($file) = $path =~ m#.*/(.*)#, $file}++ if $part =~ m#A1/#; > $file{($file = $path) =~ s#.*/##, $file}++ if $part =~ m#A1/#; > $file{join('',$path =~ m#.*/(.*)#)}++ if $part =~ m#A1/#; > or > $file{($path =~ m#.*/(.*)#)[0]}++ if $part =~ m#A1/#; > $file{substr($path,rindex($path,'/')+1)}++ if $part =~ m#A1/#; >Larry Bpbpbpbpbpbpbpbpbpbpb (the sound of shaking one's head back and forth real fast and your lips slap around). Amazing stuff.