After that, an attempt to assign anything but an unblessed array ref will fail. Continuing,use Tie::Constrained; tie my $array_ref, 'Tie::Constrained', sub { ref $_[0] eq 'ARRAY' };
There are all kinds of possibilities.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;
After Compline,
Zaxo
In reply to Re: Strict to references of a particular Variable of particular type.
by Zaxo
in thread Strict to references of a particular Variable of particular type.
by jesuashok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |