You have a bizarre idea about what "current directory" means, IMO. It
does not mean "the directory the script is in", it is the directory the user is in, as in what directory is used when you type "dir" or "ls". In Perl, you can get that path by using
cwd from the module
Cwd.
If you want to always use the directory the script is in, in theory you should be using FindBin, but it is rubbish. Instead, look at tye's mechanism to derive the directory from $0, in FindBin is broken (RE: How do I get the full path to the script executing?). rel2abs can be found in File::Spec as a class method, or in File::Spec::Functions as a function. (Both come with Perl.)
Using File::Basename, you can then extract the directory the script is in.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.