From: Andrew Ruthven Date: Wed, 7 Oct 2009 22:20:51 +0000 (+1100) Subject: Shush some warnings. X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6621ea89041f18f25fb33b92eb6ee1b59f459299;p=mail-merge.git Shush some warnings. --- diff --git a/merge.pl b/merge.pl index 2037e98..39844e3 100755 --- a/merge.pl +++ b/merge.pl @@ -73,7 +73,7 @@ while (my $cols = $csv->getline_hr($IN) ) { if ($verbose) { print "\n\nTemplate variables:\n"; for my $key (sort keys %$cols) { - print "$key: $cols->{$key}\n"; + print "$key: " . ($cols->{$key} || '') . "\n"; } print "\n"; } @@ -119,8 +119,8 @@ while (my $cols = $csv->getline_hr($IN) ) { } else { # Say who we want to send to. print "Want to send to: $cols->{'email'}" . - ($bcc ? "\n BCC " . (ref($bcc) eq 'ARRAY' ? join(", ", @{$bcc}) : $bcc) . " " : '') . - ($cc ? "\n CC " . (ref($cc) eq 'ARRAY' ? join(", ", @{$cc}) : $cc) . " " : '') . "\n"; + (defined $bcc ? "\n BCC " . (ref($bcc) eq 'ARRAY' ? join(", ", @{$bcc}) : $bcc) . " " : '') . + (defined $cc ? "\n CC " . (ref($cc) eq 'ARRAY' ? join(", ", @{$cc}) : $cc) . " " : '') . "\n"; } }