[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] weee, I get to use perl again



I could be wrong, but wouldn't something like the following work for what you want to do?  the path will stay relative to your script.

#!/usr/bin/perl -w

open(IN, "<../test/test.txt");
while(<IN>)
{
    print;
}



On 8/24/07, Larson, Timothy E. <TELarson@west.com> wrote:
Huzzah, I'm back among the Perly ones.  :)  I feel so rusty...

I want to implement a simple config file by requiring a file at runtime
- seems easy enough.  I'd like to do it smart, though, so I don't have
to edit the path in my script when this moves into production.  There's
got to be a simple way to get the abs path to <my_bin_dir>/../lib so the
thing is portable.  Only a few lines to write myself, I suppose, but
maybe even a one-liner if I just knew which function/module to use.
I've tried File::Spec and Cwd but can't get it quite right.

Baby steps back into the pool...

Tim
--
Tim Larson
InterCall, a subsidiary of West Corporation
Eschew obfuscation!
_______________________________________________
Omaha-pm mailing list
Omaha-pm@pm.org
http://mail.pm.org/mailman/listinfo/omaha-pm