in reply to Re^3: eval not working the way I expected?
in thread eval not working the way I expected?

I got rid of eval as replace it w/ below and seem to work well
Problem now is that I cannot access the hash outside of block.. why?? meaning when I do a dump on hash,(which had element in it ; by printing inside of loop) , nothing comes up.
my (%report_ccr,%report_asr); my (%report_ccr_o,%report_asr_o); my (%report_stop, %report_o_stop); for (sort keys %totalcalls_o) { my $start_o_f = ($start_o{$_}) ? $start_o{$_} : 0; #for stop record outbound side; if (exists $stop_outbound{$_}) { #print "\$stop_o{$_} is $stop_o{$_}\n"; #print "\$stop_outbound{$_} is $stop_outbound{$_}\n"; $report_o_stop{$_} = sprintf("%.2f", ( ( $stop_outbound{$_} + / 60000 ) / $stop_o{$_})) ; #resultsin min mark #print "\$report_o_stop{$_} is $report_o_stop{$_}\n"; } elsif (defined $crank_o{$_}) { $report_ccr_o{$_} = sprintf("%.2f" , ( ( $start_o_f / ($tota +lcalls_o{$_} - $crank_o{$_}) ) * 100 )); $report_asr_o{$_} = sprintf("%.2f" , ( ( $start_o_f / $total +calls_o{$_}) * 100 )); #print "\$report_ccr_o{$_} is $report_ccr_o{$_}\n"; #print "\$report_asr_o{$_} is $report_asr_o{$_}\n"; } else { $report_asr_o{$_} = sprintf("%.2f" , ( ( $start_o_f / $total +calls_o{$_}) * 100 )); # print "from last \$report_asr_o{$_} is $report_asr_o{$_}\n +"; } } print "going dumper\n"; print Dumper(%report_ccr_o);

Replies are listed 'Best First'.
Re^5: eval not working the way I expected?
by ysth (Canon) on Jan 10, 2008 at 05:08 UTC