Changeset 30 for trunk


Ignore:
Timestamp:
11/05/05 17:31:57 (19 years ago)
Author:
thauvin
Message:
  • ensure an inifile object exists
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/soft/ObsData/ObsData.pm

    • Property cvs2svn:cvs-rev changed from 1.6 to 1.7
    r29 r30  
    2929sub new { 
    3030    my ($class, $configfile) = @_; 
    31     my $obsdata = {}; 
     31    my $obsdata = { 
     32        config => new Config::IniFiles( 
     33            -file => $configfile, 
     34            -default => 'global', 
     35            -allowcontinue => 1 
     36        ), 
     37    }; 
    3238     
    3339    if ($configfile) { 
    3440        (-f $configfile && -r _) or return undef; 
    35         $obsdata->{config} = new Config::IniFiles( 
    36             -file => $configfile, 
    37             -default => 'global', 
    38             -allowcontinue => 1 
    39         ) or return undef; 
    4041    } 
     42 
     43    $obsdata->{config} or return undef; 
    4144 
    4245    bless($obsdata, $class); 
Note: See TracChangeset for help on using the changeset viewer.