diff options
Diffstat (limited to 'lib/OpenSLX/Utils.pm')
-rw-r--r-- | lib/OpenSLX/Utils.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/OpenSLX/Utils.pm b/lib/OpenSLX/Utils.pm index 3ec46dea..cb43c6ea 100644 --- a/lib/OpenSLX/Utils.pm +++ b/lib/OpenSLX/Utils.pm @@ -68,8 +68,11 @@ sub linkFile sub slurpFile { my $file = shift; - open(F, "< $file") - or die _tr("could not open file '%s' for reading! (%s)", $file, $!); + my $mayNotExist = shift; + + if (!open(F, "< $file") && !$mayNotExist) { + die _tr("could not open file '%s' for reading! (%s)", $file, $!); + } $/ = undef; my $text = <F>; close(F); |