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

[MacPerl] Easy regex?



	Hi All

	I want a directory path to the directory the script is in, but the
env. var. SCRIPT_NAME returns a path with the file name on the end so I
wonder if someone can help with an easy regex, (or maybe suggest a method
that'll return the directory)  to truncate a directory path by chopping off
the filename at the end, eg

> $orig_path =
> "server.mydomain.de/directory1/directory2/irritating_filename.pl";
> 
> and I want 
> 
> $desired_path ="server.mydomain.de/directory1/directory2/";
> 
> the number of directories and their names is variable; the name and of the
> irritating file and the length of it's name may change, but for the time
> being assume *.pl
> 
> 
> Many thanks 
> 
> 
> Lachlan Scott
> 

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