Help for this page

Select Code to Download


  1. or download this
    open(FILE,'../env.conf') or die "not there";
    
  2. or download this
    my $content = do {local $/; <FILE>};
    
  3. or download this
    my %conf = map { /^([^=]+)=(.*)$/; $1 => $2 } split /\n/, $content;
    
  4. or download this
    my %conf;
    while (<FILE>) {
    ...
       my ($k,$v) = $_ =~ /^([^=]+)=(.*)$/;
       $conf{$k} = $v if $k;
    }