| |||||||
|
|
Click here to download plain text source code.
# subroutine name: readdata_nolock # Reads all data from datafile without file locking # If error occurs (e.g. file doesn't exist), makes CGI process exit with error # Returns: reference to the array of lines, trailing "\n" in each # line is not removed sub readdata_nolock { my($datafile) = @_; my @data; local *DATA; if (open(DATA,"<$datafile")) { my $line; while ($line = <DATA>) { push (@data, $line); }; close(DATA); } else { die("Error in subroutine readdata_nolock: Can't open $datafile. Reason: $!"); } return \@data; } |
|||||||||||||||||||||
| Copyright © 1999-2007 Atomicsoft Ltd. All Rights Reserved. | ||