My problem is as follows: I have a double hash called 'quantum' which references arrays. One hash is for an i.d. number, while the other is for a date. (So each quantum{$id}{$date} is an array organized by id and date). When I try to run my code, it stops at the same line each time, complaining about my use of a string (the date) as a HASH ref. It seems to complain about different date strings from my .csv file each time I run it, if that helps. It also says the error occurred at the final line of the .csv file. The second foreach loop in the code below is the line of code where the error is found. I've omitted what's inside the loops since it doesn't seem to affect the error.
foreach $id (sort keys %quantum) { foreach $date ( sort {$a->{int(substr($quantum{$id},2,2))} <=> $ +b->{int(substr($quantum{$id},2,2))} || $a->{int(substr($quantum{$id},0,2))} <=> $b->{int(substr($q +uantum{$id},0,2))} } keys %{$quantum{$id}}) { } }
In reply to Can't use string as a HASH ref by tentacoolstuff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |