in reply to avoid uninitialized values for $_
Are you aware that skipblanks() does not iterate over @data? The following code should do the same as your function:use warnings; .. # in the block no warnings qw(uninitialized);
sub skipblanks { # my @data = @_; # you probably want $x = shift || 0; my $x = shift; # foreach $x (@data) { if ($x) { $x =~ s/,/\./g; } return $x; # } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: avoid uninitialized values for $_
by GertMT (Hermit) on Nov 06, 2007 at 12:51 UTC |