New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scalar( %tied_hash) #6051
Comments
From rir@attbi.comCreated by rir@attbi.comA snippet like "if ( %tied_hash) { impossible_call() }", is Perl Info
|
From @ysthOn 1 Nov 2002 00:28:46 -0000, rir@attbi.com wrote:
I also reported this a little while ago. It is difficult to fix. print each(%stdhash),scalar(%stdhash),each(%stdhash) won't work like: print each(%tiedhash),scalar(%tiedhash),each(%tiedhash) Anyone have any good answers? The workaround is to say: |
From @mjdominus
Couldn't pp_rv2hv be fixed so that it would check for a HASHSIZE HASHSIZE could also be called by keys() in scalar context, which would |
From rick.delaney@rogers.comMark Jason Dominus <mjd@plover.com> writes:
Sounds good to me.
This may be of some use, if it wasn't rejected because it is unwanted: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg00613.html -- |
From @ysthOn Fri, 01 Nov 2002 00:02:50 -0500, mjd@plover.com wrote:
and pp_padhv
Good! But scalar keys %hash *does* reset the iterator for a standard Also, for scalar(%hash), all we really want to do is tell if it is |
From rir@attbi.comOn Fri, Nov 01, 2002 at 05:46:52AM -0000, Yitzchak Scott-Thoennes wrote:
Thanks all. I'm not pretending to teach anyone here, rather I'm trying to If a tied hash can determine its context the problem is at least Have a tied-hash by default return 0 in scalar context, preserving
This is my thinking also. But HASHSIZE might mask the possible HASHSIZE is a different issue though, I was thinking of something like HASHSIZE does evoke the idea of LISTVALUE which would yield the foreach ( keys %hash) { I have not written such code so I don't know whether SCALARVALUE and LISTVALUE _might_ be merged into one -- |
From @iabynFrom 5.9.1 onwards, %tied_hash in boolean context checks the SCALAR() |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#18186 (status was 'resolved')
Searchable as RT18186$
The text was updated successfully, but these errors were encountered: