Changeset 7681


Ignore:
Timestamp:
2004-07-01T09:16:17+12:00 (20 years ago)
Author:
jrm21
Message:

more portable way of reading config file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/DBPlug.pm

    r7508 r7681  
    134134
    135135    # read in config file.
    136     eval `cat $filename`;
     136    if (!open (CONF, $filename)) {
     137        print $outhandle "DBPlug: can't read $filename: $!\n";
     138        return 0;
     139    }
     140    undef $/;       # don't use \n as line separator
     141    my $conf = <CONF>;  # reads in whole file
     142    $/ = "\n";      # set line separator back
     143    close CONF;
     144    eval $conf;     # execute the perl commands in that file
    137145
    138146    if (!defined($db)) {
Note: See TracChangeset for help on using the changeset viewer.