in reply to Re: newbie quesiton:how to open file in crob job?
in thread newbie quesiton:how to open file in crob job?
Also, if you are confident that the config file is always installed in the same directory as the perl script, then you can check the vale of $0 (that's "dollar-sign, digit-zero"):use Cwd; # ... my $cwd = getcwd(); # ...
use File::Basename; # another core module # ... my $script_path = ( fileparse( $0 ))[1]; # look for config file in $s +cript_path # (update: as peckingham points out, "dirname()" is easier)
|
|---|