http://www.perlmonks.org?node_id=1220371

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, i have written a script that reads some data and reports about it. Only when i use warnings i got the following complaint: 'Argument "" isn't numeric in printf at C:\Strawberry\codes\pack.pl line 11, <DATA> line 3.

Here's my code:

use strict; #use warnings; printf("%-11s %-27s %9s %11s","Date","Description","Incoming","Outgoin +g\n"); my $x = 0; my $tot; my $totex; while(<DATA>){ if($x==0){$x++;next;} my($date,$des,$inc,$exp)= unpack("A10 A27 A10 A*",$_); printf("%-10s %-27s %10.2f %10.2f\n",$date,$des,$inc,$exp); $tot += $inc; $totex += $exp; } printf("%38s %10.2f %10.2f","Totals",$tot,$totex); __DATA__ Date Description incoming outgoing 01/24/2001 Zed's Camel Emporium 100.00 1147.99 01/28/2001 Flea spray 24.99 01/29/2001 Camel rides to tourists 235.00 01/31/2001 avage1 125.00 01/20/2001 carpe diem 20.00 23.00

How can i get rid of this, besides from turning warnings off?