in reply to Trimming of the decimal part.

Use printf or sprintf instead:

perl -e '$x=100.09;printf "%d\n",$x' 100

Update: In your case, something like this should work (note that I have corrected a reference to $data too):

while (my $data = $_src_dbh->get_array()) { my $record = sprintf "%s%s%d",join(",", @$data); print "$record\n"; }

Update2: Oops!, sprintf should be called without joining the array. Sorry. This is the corrected version:

while (my $data = $_src_dbh->get_array()) { my $record = sprintf "%s,%s,%d\n",@$data); print $record; }

citromatik

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.