laziness, impatience, and hubris | |
PerlMonks |
Creating Reports with hashes: Use of uninitialized value while adding integersby GertMT (Hermit) |
on Jan 26, 2012 at 15:09 UTC ( [id://950114]=perlquestion: print w/replies, xml ) | Need Help?? |
GertMT has asked for the wisdom of the Perl Monks concerning the following question: ...UPDATED... hello all, I've been creating various reports with this script I wrote. Though I do not understand why I need to gave "no warnings - line 52" for a column that only has integers. Can someone explain me why this happens?
Data either in DATA or FILE didn't make a difference. or just However then I get a complain about:
Use of uninitialized value $total in addition (+) at /Volumes/gertmt/Documents/Programming-Folder/HoH_TreeCollection.pl line 54, <DATA> line 9 (#1) ... Use of uninitialized value $total in string at /Volumes/gertmt/Documents/Programming-Folder/HoH_TreeCollection.pl line 55, <DATA> line 9 (#1) Use of uninitialized value $quant in string at /Volumes/gertmt/Documents/Programming-Folder/HoH_TreeCollection.pl line 50, <DATA> line 9 (#1)The output is printed at the bottom of the code. Thanks for your wisdom, Gert Gives with warnings as mentioned above while no value for undefined is given (is the undefined the problem?) Planted in year: 2008 ===================== size: 25 Totaal Basswood: 9 Totaal: 9 0 Planted in year: 2009 ===================== size: 10 20 25 Totaal Cypress: 1 Oak: 4 2 0 Totaal: 4 1 2 0 Planted in year: 2010 ===================== size: 10 20 24 Totaal Basswood: 7 Cypress: 3 0 Oak: 5 2 0 Totaal: 5 5 7 0 Planted in year: 2011 ===================== size: 11 Totaal Pine: 5 Totaal: 5 0 Total no trees planted: 38
Back to
Seekers of Perl Wisdom
|
|