Hi,
Im not sure whether this is a bug for all users or just me because Ive been modding nph-build but when I tried to run nph-build.cgi from SSH it told me about an error in Condition.pm.
Original Code:
sub as_hash {
my $cond = shift;
ref $cond eq 'HASH' and return $cond;
my $href = {};
foreach my $arr (@{$cond->{cond}}) {
if (ref $arr eq ref []) {
$href->{$arr->[0]} = $arr->[2];
}
else {
my $h = _as_hash ($arr);
for my $k (keys %{$h}) {
$href->{$k} = $h->{$k};
}
}
}
return $href;
}
1;
...fixed code:
sub as_hash {
my $cond = shift;
ref $cond eq 'HASH' and return $cond;
my $href = {};
foreach my $arr (@{$cond->{cond}}) {
if (ref $arr eq ref []) {
$href->{$arr->[0]} = $arr->[2];
}
else {
my $h = as_hash ($arr);
for my $k (keys %{$h}) {
$href->{$k} = $h->{$k};
}
}
}
return $href;
}
1;
The underscore needed to be removed.
Paul Wilson.
(Dont blame me if I'm wrong!)
Im not sure whether this is a bug for all users or just me because Ive been modding nph-build but when I tried to run nph-build.cgi from SSH it told me about an error in Condition.pm.
Original Code:
sub as_hash {
my $cond = shift;
ref $cond eq 'HASH' and return $cond;
my $href = {};
foreach my $arr (@{$cond->{cond}}) {
if (ref $arr eq ref []) {
$href->{$arr->[0]} = $arr->[2];
}
else {
my $h = _as_hash ($arr);
for my $k (keys %{$h}) {
$href->{$k} = $h->{$k};
}
}
}
return $href;
}
1;
...fixed code:
sub as_hash {
my $cond = shift;
ref $cond eq 'HASH' and return $cond;
my $href = {};
foreach my $arr (@{$cond->{cond}}) {
if (ref $arr eq ref []) {
$href->{$arr->[0]} = $arr->[2];
}
else {
my $h = as_hash ($arr);
for my $k (keys %{$h}) {
$href->{$k} = $h->{$k};
}
}
}
return $href;
}
1;
The underscore needed to be removed.
Paul Wilson.

(Dont blame me if I'm wrong!)