(map { $_ => $_ } ( 'gt', 'lt', 'eq', 'ne', 'ge', 'le' )),
);
-sub conditional_passes
+sub _conditional_passes
{
my $self = shift;
my ($context) = @_;
? $isOp{$op}
: '==';
- # Force numerical context on both values;
- $value *= 1;
- $val *= 1;
-
my $res;
for ($op)
{
die "Unknown operator in conditional resolve", $/;
}
- return 0 unless $res;
+ return $res && 1;
}
- elsif (my $is = uc $context->get($self, 'IS'))
+
+ my $istrue = $val && 1;
+
+ my $is = uc $context->get($self, 'IS') || 'TRUE';
+ if ($is eq 'TRUE')
{
- my $istrue = $val && 1;
- if ($is eq 'TRUE')
- {
- return 0 unless $istrue;
- }
- else
- {
- warn "Conditional 'is' value was [$is], defaulting to 'FALSE'" . $/
- if $is ne 'FALSE';
+ return 0 unless $istrue;
+ }
+ else
+ {
+ warn "Conditional 'is' value was [$is], defaulting to 'FALSE'" . $/
+ if $is ne 'FALSE' && $^W;
- return 0 if $istrue;
- }
+ return 0 if $istrue;
}
return 1;
my $self = shift;
my ($context) = @_;
- return 1 unless $self->conditional_passes($context);
+ return 1 unless $self->_conditional_passes($context);
return $self->iterate_over_children($context);
}
my $self = shift;
my ($context, $attr) = @_;
- return 0 unless $self->conditional_passes($context);
+ return 0 unless $self->_conditional_passes($context);
return $self->SUPER::max_of($context, $attr);
}
my $self = shift;
my ($context, $attr) = @_;
- return 0 unless $self->conditional_passes($context);
+ return 0 unless $self->_conditional_passes($context);
return $self->SUPER::total_of($context, $attr);
}
If VALUE is not set, then IS is checked. IS is allowed to be either "TRUE" or
"FALSE". The boolean value of NAME is checked against IS.
-=back 4
+=back
=head1 CHILDREN
=head1 AUTHOR
-Rob Kinyon (rkinyon@columbus.rr.com)
+Rob Kinyon (rob.kinyon@gmail.com)
=head1 SEE ALSO