mirror of
https://github.com/correl/mage.git
synced 2024-12-01 03:00:09 +00:00
updated gen-card.pl with clearer error handling
This commit is contained in:
parent
ab548cc01c
commit
6e4ac3899b
1 changed files with 5 additions and 5 deletions
|
@ -32,7 +32,7 @@ sub fixCost {
|
||||||
|
|
||||||
my $author;
|
my $author;
|
||||||
if (-e $authorFile) {
|
if (-e $authorFile) {
|
||||||
open (DATA, $authorFile);
|
open (DATA, $authorFile) || die "can't open $authorFile : $!";
|
||||||
$author = <DATA>;
|
$author = <DATA>;
|
||||||
chomp $author;
|
chomp $author;
|
||||||
close(DATA);
|
close(DATA);
|
||||||
|
@ -40,14 +40,14 @@ if (-e $authorFile) {
|
||||||
$author = 'anonymous';
|
$author = 'anonymous';
|
||||||
}
|
}
|
||||||
|
|
||||||
open (DATA, $dataFile) || die "can't open $dataFile";
|
open (DATA, $dataFile) || die "can't open $dataFile : $!";
|
||||||
while(my $line = <DATA>) {
|
while(my $line = <DATA>) {
|
||||||
my @data = split('\\|', $line);
|
my @data = split('\\|', $line);
|
||||||
$cards{$data[0]}{$data[1]} = \@data;
|
$cards{$data[0]}{$data[1]} = \@data;
|
||||||
}
|
}
|
||||||
close(DATA);
|
close(DATA);
|
||||||
|
|
||||||
open (DATA, $setsFile) || die "can't open $setsFile";
|
open (DATA, $setsFile) || die "can't open $setsFile : $!";
|
||||||
while(my $line = <DATA>) {
|
while(my $line = <DATA>) {
|
||||||
my @data = split('\\|', $line);
|
my @data = split('\\|', $line);
|
||||||
$sets{$data[0]}= $data[1];
|
$sets{$data[0]}= $data[1];
|
||||||
|
@ -55,14 +55,14 @@ while(my $line = <DATA>) {
|
||||||
}
|
}
|
||||||
close(DATA);
|
close(DATA);
|
||||||
|
|
||||||
open (DATA, $knownSetsFile) || die "can't open $knownSetsFile";
|
open (DATA, $knownSetsFile) || die "can't open $knownSetsFile : $!";
|
||||||
while(my $line = <DATA>) {
|
while(my $line = <DATA>) {
|
||||||
my @data = split('\\|', $line);
|
my @data = split('\\|', $line);
|
||||||
$knownSets{$data[0]}= $data[1];
|
$knownSets{$data[0]}= $data[1];
|
||||||
}
|
}
|
||||||
close(DATA);
|
close(DATA);
|
||||||
|
|
||||||
open (DATA, $keywordsFile) || die "can't open $keywordsFile";
|
open (DATA, $keywordsFile) || die "can't open $keywordsFile : $!";
|
||||||
while(my $line = <DATA>) {
|
while(my $line = <DATA>) {
|
||||||
my @data = split('\\|', $line);
|
my @data = split('\\|', $line);
|
||||||
$keywords{toCamelCase($data[0])}= $data[1];
|
$keywords{toCamelCase($data[0])}= $data[1];
|
||||||
|
|
Loading…
Reference in a new issue