In message <[EMAIL PROTECTED]>
Nathan Torkington <[EMAIL PROTECTED]> wrote:
> Tom Hughes writes:
> > I must admit it had never occurred to me that somebody might
> > deliberately use keys or values to achieve that, but I guess
> > somebody might be relying on it without realising it.
>
In message <[EMAIL PROTECTED]>
Jerrad Pierce <[EMAIL PROTECTED]> wrote:
> >As far as I can tell reset %x currently tries to reset any
> >variables which start with either % or x even though no variable
> >can start with %...
>
> ~/perl
> ${"%percent"} = "Quoth the raven";
> print ${"%pe
>As far as I can tell reset %x currently tries to reset any
>variables which start with either % or x even though no variable
>can start with %...
~/perl
${"%percent"} = "Quoth the raven";
print ${"%percent"}, "\n";
reset("%");
print ${"%percent"}, "\n";
Quoth the raven
Sure looks like it starts
Tom Hughes writes:
> I must admit it had never occurred to me that somebody might
> deliberately use keys or values to achieve that, but I guess
> somebody might be relying on it without realising it.
while (($k,$v) = each %foo) {
last if ...;
}
keys %foo;# reset the iterator
w
In message <[EMAIL PROTECTED]>
Nathan Torkington <[EMAIL PROTECTED]> wrote:
> Resetting an each() should be done in some other way than calling
> keys() or values(). Perhaps reset(%hash)? I'm subfond of the current
> reset() semantics (symbol table crackheadery + single-match regexp
>
>Tom Christiansen writes:
>> But %hash->BUCKET_USE() should return what's currently there.
>Do you really use this information? Really? I have no objection
>to supplying a way to discover it, but this might even be in an
>external module rather than built into the language given how rarely
>it'
Tom Christiansen writes:
> But %hash->BUCKET_USE() should return what's currently there.
Do you really use this information? Really? I have no objection
to supplying a way to discover it, but this might even be in an
external module rather than built into the language given how rarely
it's used
>I was against the idea of hash context, but I'd love it if:
> foreach ($k,$v) (%hash) {
>...
> }
I'd like for Perl to emit a warning if people try
for (%hash)
or its aliases. That is, if a foreach loops sole content is
a %{...} at compile time, grinch.
--tom
>%hash in scalar context should return what scalar(keys(%hash))
>currently does.
But %hash->BUCKET_USE() should return what's currently there.
And a simple boolean (read: don't care) use shouldn't waste time
looking for keys, really, but should be internally optimized to do
the current reasonabl