Carp module in innreport
Julien ÉLIE
julien at trigofacile.com
Tue Oct 7 17:21:21 UTC 2008
Hi,
May we add a dependence with Carp in innreport?
I do not know whether it is widely distributed and available from
standard Perl installations.
I ask because of Alexander's patch which uses that Perl module.
> --- scripts/innreport.in (revision 8020)
> +++ scripts/innreport.in (working copy)
[...]
> use strict;
> +use Carp qw(confess);
[...]
> my $total = 0;
> - my ($key1, $key2);
> - foreach $key1 (keys (%$h)) {
> - foreach $key2 (keys (%{$$h{$key1}})) {
> - $total += ${$$h{$key1}}{$key2};
> + while(my ($key1, $value1) = each %$h) {
> + confess $key1 unless(defined($value1));
> + while(my ($key2, $value2) = each %$value1) {
> + confess $key2 unless(defined($value2));
> + $total += $value2;
> }
> }
[...]
P.-S.: Thanks, Russ, for the FAQ!
--
Julien ÉLIE
« Une fois rien, c'est rien ; deux fois rien, c'est pas beaucoup,
mais pour trois fois rien, on peut déjà acheter quelque chose,
et pour pas cher. » (Raymond Devos)
More information about the inn-workers
mailing list