Commit fc8b83bb authored by Leigh Stoller's avatar Leigh Stoller

Add ReadFile() convenience function.

parent 6ce9e232
......@@ -36,7 +36,7 @@ use POSIX qw(ceil);
use vars qw(@ISA @EXPORT);
@ISA = "Exporter";
@EXPORT = qw (MapUserURN MapProjectURN);
@EXPORT = qw (MapUserURN MapProjectURN ReadFile);
# Must come after package declaration!
use emdb;
......@@ -130,6 +130,18 @@ sub MapUserURN($)
return undef;
}
#
# Convenience
#
sub ReadFile($) {
local $/ = undef;
my ($filename) = @_;
open(FILE, $filename) or fatal("Could not open $filename: $!");
my $contents = <FILE>;
close(FILE);
return $contents;
}
#
# Given a reservation details hash, calculate a utilization number
# from the history array.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment