Re: Array Question
- From: Tad McClellan <tadmc@xxxxxxxxxxxxxx>
- Date: Sat, 13 Jan 2007 07:48:10 -0600
amerar@xxxxxxx <amerar@xxxxxxx> wrote:
following error:
It is a warning message, not an error message.
Argument "" isn't numeric in printf at ./saba.pl line 151, <BFILE> line^^
^^
Looks like you have an empty string somewhere.
Here is line 151:
printf FAN "@work_format\n",@d_ar;
Now, this is where it get crazy. @work_format is a FORMAT that looks
like this:
my @work_format=qw/%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s
%s %s %s %.3f %.3f %.3f %.3f
%.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f %.3f
[ snip a whole bunch more ]
My question is, how the hell do I know which element is throwing the
error??
By dumping the array.
I've dumped the array,
Good idea.
which looks like this:
158: +000000000000000.000
159: +000000000000010.000
160: +000000000000000.000
161: +000000000002200.000
162: +000000000000000.000
163:
164: +000000000005000.000
165:
166: +000000000000000.000
Those are elements of the array. It works with all other records in
the file except for this one. How do I know which format is throwing
the error????
Then ones that correspond to the empty strings.
Can anyone help?
With what?
You already know how to tell which format is causing the warning...
I've been at this for 4 days now.....
.... so by now you should have moved on to answering the next question:
Why does this record contain empty strings?
We cannot help you with that because we don't know how @d_ar
is being populated.
--
Tad McClellan SGML consulting
tadmc@xxxxxxxxxxxxxx Perl programming
Fort Worth, Texas
.
- References:
- Array Question
- From: amerar@xxxxxxx
- Array Question
- Prev by Date: Re: Graph in Perl
- Next by Date: FAQ 2.3 I don't have a C compiler. How can I build my own Perl interpreter?
- Previous by thread: Re: Array Question
- Next by thread: How to map from Unix to Windows
- Index(es):
Relevant Pages
|