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.
In reply to working with relative paths by apotheon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |