Changeset 11498 for trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
- Timestamp:
- Jan 31, 2007, 2:52:42 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
r11497 r11498 1 1 # Copyright (c) 2006 Paul Price, Joshua Hoblitt 2 2 # 3 # $Id: Config.pm,v 1.2 5 2007-01-31 23:41:36eugene Exp $3 # $Id: Config.pm,v 1.26 2007-02-01 00:52:42 eugene Exp $ 4 4 5 5 package PS::IPP::Config; … … 100 100 101 101 my @path = split /:/, $self->{path}; # List of paths to try 102 my $found; # Found it? 102 my $found = 0; # Found it? 103 my $realfile; 103 104 foreach my $path (@path) { 104 my $test= File::Spec->rel2abs( $filename, $path );105 if (-f $ test) {106 $found = $test;105 $realfile = File::Spec->rel2abs( $filename, $path ); 106 if (-f $realfile) { 107 $found = 1; 107 108 last; 108 109 } 109 110 } 110 if (not defined$found) {111 if (not $found) { 111 112 ## try again after a moment? 112 113 system ("df"); … … 114 115 115 116 ## try a second time 116 my $found;117 117 foreach my $path (@path) { 118 118 print "trying: filename: $filename, path: $path -> "; 119 my $test= File::Spec->rel2abs( $filename, $path );120 print "test: $ test\n";121 if (-f $ test) {122 $found = $test;119 $realfile = File::Spec->rel2abs( $filename, $path ); 120 print "test: $realfile\n"; 121 if (-f $realfile) { 122 $found = 1; 123 123 last; 124 124 } 125 125 } 126 croak "Unable to find camera configuration file $filename\n" if not defined$found;126 croak "Unable to find camera configuration file $filename\n" if not $found; 127 127 } 128 128 129 129 # Read the file 130 open my $file, $ found or croak "Unable to open camera configuration file $found: $!";130 open my $file, $realfile or croak "Unable to open camera configuration file $realfile: $!"; 131 131 my @contents = <$file>; 132 132 close $file;
Note:
See TracChangeset
for help on using the changeset viewer.
