note
Anonymous Monk
<p><i> I like that better than expecting a ->param, since that breaks it away from the contract of purely hash->hash. </i> <p> Adding a branch breaks no contracts
<c>
sub build_cgi_struct
{
my ($iv, $errs, $conf) = @_;
use Scalar::Util qw(blessed);
my $blessed = blessed $iv;
my $splitnull = 1;
if( $blessed and UNIVERSAL::can( $iv, 'param') ){
$splitnull = 0;
if( $iv->isa('CGI') ){
$iv = $iv->{"param"} ; # cheat :)
} else {
$iv = { map { $_ => [ $iv->param($_) ] } $iv->param };
}
}
...
... if $splitnull;
</c>
872768
986330
0