CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [BillKSmith] Sorting hash by value: Edit Log



niall_heavey
Novice

Jul 19, 2010, 8:27 AM


Views: 7663
Re: [BillKSmith] Sorting hash by value

Ok, I have now changed this to a database and have it working (sorting the values). However for some reason it only works with small files and not the large one that I need.
It is giving me errors/warnings that I think might be causing the problem, these are

Use of uninitialized value in addition (+) at simplify.pl line 41.
Use of uninitialized value in addition (+) at simplify.pl line 52.
Use of uninitialized value in addition (+) at simplify.pl line 41.
Use of uninitialized value in addition (+) at simplify.pl line 52.
Use of uninitialized value in addition (+) at simplify.pl line 52.
HASH(0x8647968)


Line 41 and 52 are as follows:

Code
34. if (exists($index{$data3})) 
35. {
36. $index->{ $data3 } = 1;
37.
38. }
39. else
40. {
41. $index->{ $data3 } = $index->{ $data3 }+1 ;
42.
43. }
44.
45. if (exists($index{$data5}))
46. {
47. $index->{ $data5 } = 1;
48.
49. }
50. else
51. {
52. $index->{ $data5 } = $index->{ $data5 }+1 ;
53.
54. }

I have tried a few things to sort out these problems, some of them get rid of the messages but then the code does not sort the values etc.

Any ideas where the problem might be with these errors?

Thanks!
N


(This post was edited by niall_heavey on Jul 19, 2010, 8:49 AM)


Edit Log:
Post edited by niall_heavey (Novice) on Jul 19, 2010, 8:38 AM
Post edited by niall_heavey (Novice) on Jul 19, 2010, 8:49 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives