Commit cc739024 authored by Jonathon Duerig's avatar Jonathon Duerig

Now properly dies when one of the input files cannot be opened. This prevents...

Now properly dies when one of the input files cannot be opened. This prevents missing file problems from propogating.
parent 5bd6a251
......@@ -15,7 +15,8 @@ sub setupDest
my $fileName = $basePath.'/dest'.$_[0].'.dump';
my %hash;
my $file;
open($file, "<".$fileName);
open($file, "<".$fileName)
or die("Couldn't open file $fileName for reading");
my @array = <$file>;
for ($i = 0; $i < @array; ++$i)
{
......@@ -34,7 +35,8 @@ sub setupDest
return %hash;
}
open(SOURCE_IN, "<$basePath/source.dump");
open(SOURCE_IN, "<$basePath/source.dump")
or die("Couldn't open file $basePath/source.dump for reading");
@source = <SOURCE_IN>;
close(SOURCE_IN);
......
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