[LON-CAPA-cvs] cvs: loncom /xml lontable.pm
raeburn
raeburn at source.lon-capa.org
Sun Dec 14 19:52:40 EST 2014
raeburn Mon Dec 15 00:52:40 2014 EDT
Modified files:
/loncom/xml lontable.pm
Log:
- Coding style: keys()
Index: loncom/xml/lontable.pm
diff -u loncom/xml/lontable.pm:1.21 loncom/xml/lontable.pm:1.22
--- loncom/xml/lontable.pm:1.21 Wed Nov 30 18:01:33 2011
+++ loncom/xml/lontable.pm Mon Dec 15 00:52:40 2014
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Generating TeX tables.
#
-# $Id: lontable.pm,v 1.21 2011/11/30 18:01:33 raeburn Exp $
+# $Id: lontable.pm,v 1.22 2014/12/15 00:52:40 raeburn Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -276,7 +276,7 @@
};
- foreach my $key (keys %$configuration) {
+ foreach my $key (keys(%$configuration)) {
$self->{$key} = $$configuration{$key};
}
@@ -500,7 +500,7 @@
# Override the defaults if the config hash is present:
if (defined($config)) {
- foreach my $key (keys %$config) {
+ foreach my $key (keys(%$config)) {
$row_hash->{$key} = $config->{$key};
}
}
@@ -583,7 +583,7 @@
}
my $row = $self->{'rows'}->{$self->{'part'}}->[-1];
- foreach my $config_item (keys %$config) {
+ foreach my $config_item (keys(%$config)) {
$row->{$config_item} = $config->{$config_item};
}
}
@@ -996,7 +996,7 @@
my $specified_width = 0.0;
my $specified_cols = 0;
- foreach my $col (keys %$colwidths) {
+ foreach my $col (keys(%$colwidths)) {
$specified_width = $specified_width + $colwidths->{$col};
$specified_cols++;
}
@@ -1026,7 +1026,7 @@
$default_width = ($tablewidth/$unspecified_cols); # 'fair' default width.
my $width_remaining = $tablewidth - $default_width*$unspecified_cols; # What's left for the specified cols.
my $reduction = $tablewidth/$width_remaining; # Reduction fraction for specified cols
- foreach my $col (keys %$colwidths) {
+ foreach my $col (keys(%$colwidths)) {
$colwidths->{$col} = $colwidths->{$col}/$reduction;
}
More information about the LON-CAPA-cvs
mailing list