in reply to Re: Searching in an array of arrays
in thread Searching in an array of arrays

Oops! I tested your code by reading the data from a text file to build @data, and it worked fine. While trying to
run your code with the rest of my code( I have built @data by parsing an XML file using XML::XPath), I'm getting errors similar to this
Operation `/': no method found, left argument in overloaded package XML::XPath::Literal,right argument has no overloaded magic at C:\..\xmlrecord_parse.pl line 608. Tool completed with exit code 255
So I've changed this portion of code, but I'm not sure if this is correct :
return 5 if (int($_[0]) >= 40); return 0 if (int($_[0]) < 20); return ((int($_[0]) / 5) - 3);
However, the results printed now are:
1-1-2004 5-1-2004 mild
Whereas they should be:
1-1-2004 5-1-2004 mild 10-1-2004 14-1-2004 very warm
Data
1-1-2004 15.0 2-1-2004 15.5 3-1-2004 16.5 4-1-2004 17.0 5-1-2004 17.5 6-1-2004 18.0 7-1-2004 18.5 8-1-2004 19.0 9-1-2004 19.5 10-1-2004 25.0 11-1-2004 26.5 12-1-2004 27.5 13-1-2004 28.0 14-1-2004 29.5 15-1-2004 28.0 16-1-2004 28.8
What do I need to change in the code?
Thanks,
perl_seeker :)