apotheon has asked for the wisdom of the Perl Monks concerning the following question:
I'm running Perl 5.x on a Debian GNU/Linux system here, and wrote a simple script last night to normalize hundreds of filenames for me. A minor issue I've run into is with defining a directory path for the script to use. A snippet of relevant example code follows (slightly modified so that it makes sense without the rest of the script):
my $direct; chomp($direct = $ARGV[0]); chdir($direct);
Basically, this script as currently written forces me to use absolute paths, whereas I'd like to make it use relative paths. Best would be path relative to where I am in the filesystem when I run it, but it won't even recognize relative path from the location of the script, which just boggles my mind. What am I missing?
I've done searches at PerlMonks, looked through several books (including Visual Quickstart: Perl and CGI for the World Wide Web, the llama, and Perl in a Nutshell), and browsed through online tutorials, but haven't discovered anything particularly helpful on the matter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: working with relative paths
by steves (Curate) on Oct 30, 2004 at 01:57 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 02:19 UTC | |
by itub (Priest) on Oct 30, 2004 at 02:29 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 03:12 UTC | |
by fglock (Vicar) on Oct 30, 2004 at 03:27 UTC | |
| |
|
Re: working with relative paths
by bobf (Monsignor) on Oct 30, 2004 at 04:00 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 04:07 UTC | |
|
Re: working with relative paths
by TedPride (Priest) on Oct 30, 2004 at 02:33 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 03:05 UTC | |
|
Re: working with relative paths
by ccn (Vicar) on Oct 30, 2004 at 20:05 UTC | |
by apotheon (Deacon) on Oct 30, 2004 at 20:28 UTC | |
by chanio (Priest) on Oct 31, 2004 at 03:55 UTC |