in reply to Trimming of the decimal part.
Untested:
I assume now that $data is an array ref and @data was a typo in your code and should have been @$data.use strict; use warnings; use Scalar::Utils qw(looks_like_number); while (my $data = $_src_dbh->get_array()) { foreach my $elem (@$data) { $elem = int($elem) if looks_like_number($elem); } local $, = ','; print @$data; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trimming of the decimal part.
by mr_mischief (Monsignor) on Apr 23, 2008 at 18:17 UTC | |
by mscharrer (Hermit) on Apr 23, 2008 at 18:49 UTC |