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

Jesse Andersen gotosleep at gmail.com
Fri Aug 24 16:36:17 PDT 2007


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 at 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 at pm.org
> http://mail.pm.org/mailman/listinfo/omaha-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/omaha-pm/attachments/20070824/9a112bd3/attachment.html 


More information about the Omaha-pm mailing list