From 6e4ac3899b1479af50e72e2a8d738fae3032a2dd Mon Sep 17 00:00:00 2001 From: "antonig@sas.upenn.edu" Date: Wed, 17 Apr 2019 21:57:07 -0400 Subject: [PATCH] updated gen-card.pl with clearer error handling --- Utils/gen-card.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Utils/gen-card.pl b/Utils/gen-card.pl index 44abc4a54c..3c2e34b1c2 100755 --- a/Utils/gen-card.pl +++ b/Utils/gen-card.pl @@ -32,7 +32,7 @@ sub fixCost { my $author; if (-e $authorFile) { - open (DATA, $authorFile); + open (DATA, $authorFile) || die "can't open $authorFile : $!"; $author = ; chomp $author; close(DATA); @@ -40,14 +40,14 @@ if (-e $authorFile) { $author = 'anonymous'; } -open (DATA, $dataFile) || die "can't open $dataFile"; +open (DATA, $dataFile) || die "can't open $dataFile : $!"; while(my $line = ) { my @data = split('\\|', $line); $cards{$data[0]}{$data[1]} = \@data; } close(DATA); -open (DATA, $setsFile) || die "can't open $setsFile"; +open (DATA, $setsFile) || die "can't open $setsFile : $!"; while(my $line = ) { my @data = split('\\|', $line); $sets{$data[0]}= $data[1]; @@ -55,14 +55,14 @@ while(my $line = ) { } close(DATA); -open (DATA, $knownSetsFile) || die "can't open $knownSetsFile"; +open (DATA, $knownSetsFile) || die "can't open $knownSetsFile : $!"; while(my $line = ) { my @data = split('\\|', $line); $knownSets{$data[0]}= $data[1]; } close(DATA); -open (DATA, $keywordsFile) || die "can't open $keywordsFile"; +open (DATA, $keywordsFile) || die "can't open $keywordsFile : $!"; while(my $line = ) { my @data = split('\\|', $line); $keywords{toCamelCase($data[0])}= $data[1];