cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:
Seems a little long winded though... Is there a simpler answer?#!/usr/bin/perl use strict; use warnings; use Cwd 'abs_path'; my $script_dir = substr( abs_path($0), 0, rindex(abs_path($0),'/') ) print $script_dir.$/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Determining the directory the running script is in
by Corion (Patriarch) on Jun 26, 2007 at 16:35 UTC | |
|
Re: Determining the directory the running script is in
by Fletch (Bishop) on Jun 26, 2007 at 16:42 UTC |