Blocks

2 + 2 =

Yes, +{sum} is the correct answer ! Brilliant .. I am sorry .. +{sum} is not correct .. Please try again ! Danger, does not compute ! .. "+{sum}" is not a number !

Thanks for playing !

__PERL__ sub check { my $self=shift(); if ((my $ans=$_{'sum'}) == 4) { $self->render_block('pass') } elsif ($ans=~/^[0-9.]+$/) { $self->render_block('fail') } elsif ($ans) { $self->render_block('silly') } # Blocks aren't displayed until whole section rendered # return $self->render(); }