Changeset 21 for trunk


Ignore:
Timestamp:
09/28/05 16:54:48 (19 years ago)
Author:
thauvin
Message:
  • start global object to handle config
Location:
trunk/soft/ObsData
Files:
2 added
1 edited

Legend:

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

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r3 r21  
    55use strict; 
    66use warnings; 
     7use Config::IniFiles; 
    78 
    89our $VERSION = 0.01; 
    910 
     11sub new { 
     12    my ($class, $configfile) = @_; 
     13    my $obsdata = { 
     14        config => new Config::IniFiles( 
     15            -file => $configfile, 
     16            # -default => '', TODO 
     17            -allowcontinue => 1 
     18        ), 
     19    }; 
     20     
     21    (-f $configfile && -r _) && $obsdata->{config} or return undef; 
     22    bless($obsdata, $class); 
     23} 
     24 
     251; 
Note: See TracChangeset for help on using the changeset viewer.