- or download this
my $var=func($param) || 0;
- or download this
my ($x,$y);
$x=$x+1; # throws warning
$y+=1; # no warning
- or download this
# heres a functional way
my @no_undefs=map{$_ || 0} @has_undefs;
...
# might be slow or big lists though
sub undefs2zero {$_[$_]||=0 foreach 0..$#_}
undefs2zero(@array);