And I wouldn't necessarily use either a regex *or* substr; one of the CPAN modules like File::Spec might be more portable if that's what you like (well, that's what _I_ like... :-)) On Fri, 18 Dec 1998, Iain Chalmers wrote: And Lachlan had blurted: > > 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 > > At the risk of offending the regex gods <GRIN>, I wouldn't use a regex at all... > ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch