>Other than the issue of semantics (array is not list), I still have not
>seen:
>a) why this is the Wrong Thing
Why what is the wrong thing? Why treating an immutable list
as a mutable array is wrong? Because you can't change the length
of a list -- it doesn't have an AV to update. If you want
$n = pop fn()
you are just obfuscating writing
$n = (fn())[-1];
>b) while not the Wrong Thing, it should not be done.
It should not be done because it is wrong to lose compile-time
type checking save under grave environmental stress, the likes
of which you are yet to demonstrate. The burden of proof rests
with you to show why to turn perl dumber.
>c) something to refute Do What I Mean
You have yet to show what you mean, or that what you mean is
painful to accomplish.
There are real issues, but you've missed them. One is the
cumbersomeness of writing
while ( ($k,$v) = each %{ $x[$i][$j] } ) {}
instead of:
while ( ($k,$v) = each $x[$i][$j] ) {}
But that comes with similar attendant problems. What then
should
while ( ($k,$v) = each fn() ) {}
do? How often should fn() be called there? And what if it
returns a hash ref versus a list? What about a list of one
hash ref?
Comflating values with variables is not always sensible: consider
4++, for example; this isn't (old) FORTRAN. :-) Why you should be
able, without a whit of added notation to that effect, to pop a
function return list or each a function return list is not something
you have efffectively proven.
Catching errors is important. The dweomer you would claim desirable
is slippery magic at best, more complex than I think you think.
--tom