Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
fc8b83bb
Commit
fc8b83bb
authored
Jul 16, 2018
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ReadFile() convenience function.
parent
6ce9e232
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
apt/APT_Utility.pm.in
apt/APT_Utility.pm.in
+13
-1
No files found.
apt/APT_Utility.pm.in
View file @
fc8b83bb
...
...
@@ -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
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment