IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11835


Ignore:
Timestamp:
Feb 15, 2007, 12:35:38 PM (19 years ago)
Author:
Paul Price
Message:

Fixing some compilation errors. Fixing exit when environment variable not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Config/lib/PS/IPP/Config.pm

    r11728 r11835  
    11# Copyright (c) 2006  Paul Price, Joshua Hoblitt
    22#
    3 # $Id: Config.pm,v 1.29 2007-02-09 03:55:22 price Exp $
     3# $Id: Config.pm,v 1.30 2007-02-15 22:35:38 price Exp $
    44
    55package PS::IPP::Config;
     
    6060    $name = $ENV{HOME} . '/.ipprc' unless defined $name;
    6161
    62     open my $file, $name;
     62    my $file;                   # File handle
     63    open $file, $name;
    6364    unless ($file) {
    6465        carp "Unable to open ipprc file $name: $!";
     
    140141
    141142    # Read the file
    142     open my $file, $realfile;
     143    my $file;                   # File handle
     144    open $file, $realfile;
    143145    unless ($file) {
    144146        carp "Unable to open camera configuration file $realfile: $!";
     
    388390        my $name = $1;          # Environment variable name
    389391        my $value = $ENV{$name}; # Environment variable value
    390 #       print "Replacing $name with $value.\n";
     392        unless (defined $value) {
     393            carp "Unable to find environment variable $name";
     394            exit($PS_EXIT_SYS_ERROR);
     395        }
    391396        $dir =~ s/\$\{?$name\}?/$value\//;
    392397    }
Note: See TracChangeset for help on using the changeset viewer.