in reply to Re^2: Data::Table - empty values - avoid warnings
in thread Data::Table - empty values - avoid warnings
okay thanks a lot. I'm almost there but found out that actually the columns I'm working on have a lot of numbers that have as a decimal separator a 'comma'. For example in the blank spot number like 2,3 as opposed to the 'space'. To work around that I thought to do
: (
but it doesn't work. The 2,3 nicely changes into 2.3 but I'm obviously making a very elementary mistake that I can't understand myself at this moment as the row adds up to ... 3sub to_int_or_zero { my $value = shift; $value =~ s/,/\./; if (defined($value) && $value =~ m/^\d+$/) { return $value; } else { return 0; } }
: (
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Data::Table - empty values - avoid warnings
by eric256 (Parson) on Oct 25, 2007 at 16:39 UTC | |
by GertMT (Hermit) on Oct 25, 2007 at 18:01 UTC | |
by GertMT (Hermit) on Oct 25, 2007 at 18:53 UTC |
In Section
Seekers of Perl Wisdom