in reply to Cache, sort, and filter XML response
But I get this error:while LOOP { push @output, $xml->cdr( $xml->$label1( $hold_col_val . " " . $hold_col_val +2 ), $xml->$label2($total_cdr_count), $xml->$label3($total_call_count), $xml->$label4($total_error_count), $xml->$label5($formatMin), $xml->$label6($formatASR), $xml->$label7($formatPDD), $xml->$label8($formatDUR), $xml->$label9($hold_min_date), $xml->$label10($hold_max_date), $xml->$label11($link)); } my %sort_xml = @output; foreach my $key ( sort { $sort_xml{$a} <=> $sort_xml{$b} } ( keys(%sor +t_xml) ) ) { print $key $sort_xml{$key}; }
I am guessing I need to somehow adjust it to tell it which label 1-11 to sort on? What's that syntax? I want the order of the XML elements to be the same, but to print to screen in an ASC or DESC order based on the value of the elementOdd number of elements in hash assignment at rpt.pl line 960. Operation "<=>": no method found, left argument in overloaded package XML::Generator::pretty, right argument in overloaded package XML::Generator::pretty at rpt +.pl line 961.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Cache, sort, and filter XML response
by shmem (Chancellor) on Oct 16, 2007 at 06:12 UTC |