[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Easy regex?




>> $orig_path =
>> "server.mydomain.de/directory1/directory2/irritating_filename.pl";
>> 
>> and I want 
>> 
>> $desired_path ="server.mydomain.de/directory1/directory2/";
>> 
Your best bet is probably:

( $desired_path ) = $orig_path =~ m/(.*\/)/;

For succinctness and memory efficiency.

-Alex

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch