note
Zaxo
<p>
<code>
use Tie::Constrained;
tie my $array_ref,
'Tie::Constrained', sub { ref $_[0] eq 'ARRAY' };
</code>
After that, an attempt to assign anything but an unblessed array ref will fail. Continuing,
<code>
tie my $hash_ref,
'Tie::Constrained', sub { ref $_[0] eq 'HASH' };
tie my $scalar_ref,
'Tie::Constrained', sub { ref $_[0] eq 'SCALAR' };
tie my $scalar_value,
'Tie::Constrained', sub { not ref $_[0] };
tie my $query,
'Tie::Constrained',
sub { ref $_[0] and $_[0]->isa('CGI') },
CGI->new;
</code>
There are all kinds of possibilities.</p>
<div class="pmsig"><div class="pmsig-82147">
<p>After Compline,<br/>Zaxo</p>
</div></div>
513571
513571