in reply to Read a static file from module directory
A couple of other notes: <list># Parent script resides in /usr/local/myproject/bin # Module and config file reside in /usr/local/myproject/lib use FindBin qw($Bin); sub get_config { my $CONFIGPATH = "$Bin/../lib/acme.config"; open (CONFIG, "<$CONFIGPATH") or die "$0: File '$CONFIGPATH': $!"; undef $/; my $c=<CONFIG>; close CONFIG; return $c; }
-Matt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Read a static file from module directory
by l_millr (Initiate) on Nov 30, 2001 at 03:04 UTC |