... reads what he just wrote ...
SIGH
As a Perl hacker, I have problems with the twit who wrote the first part of this reply. I can easily see someone wanting to do something like:
package My::Overloaded::Array; use overload '+=' => 'my_push'; sub my_push { my $self = shift; push @{$self}, @_; }
Now, the hapless coder wants to have HTML::Template use it as an array. I have an object which is an arrayref and I want HTML::Template to treat it as a plain scalar that isn't a reference. And, frankly, there's no way for poor HTML::Template to tell the difference!
... thinks some more ...
Unless our intrepid array-hacking hero overloads @{} (or whatever it's called these days ... []?) ... Or, I'm stuck with my solution of overriding isa(). What are your thoughts? (Maybe there's a meditation in all this rambling I seem to be doing of late ...)
------
We are the carpenters and bricklayers of the Information Age.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.
In reply to Re: Re: Why ref() is bad.
by dragonchild
in thread Is "ref $date eq 'ARRAY'" wrong?
by bronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |