Jonathan Scott Duff wrote:
> As for $a[$something], if @a had been declared as
> "my @a : assoc;", then perl should stringify $something, otherwise
> numify.  Hmm.. I guess this implies that all hashes need to be
> pre-declared.  :-(

That was kinda along the lines of my suggestion; that the behavior
of an "array" be defined by a bound implementation.  Just like tie,
but without a syntactically supported distinction between arrays 
and hashes.  

Perhaps

        sub ARRAY::assoc::FETCH {
                my $self = shift;
                # I'm an associative array, so stringize the key:
                my $index = "$_[0]";
                ...

-- 
John Porter

Reply via email to