Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Perl oddities

by jmcnamara (Monsignor)
on Mar 01, 2005 at 16:26 UTC ( #435510=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl oddities
in thread Perl oddities


In the above case yes but as the number of keys is increased the buckets will get reused and the result won't be correct:
$ perl -le '%h = (1 .. 10); print scalar %h' 5/8 $ perl -le '%h = (1 .. 12); print scalar %h' 5/8 $ perl -le '%h = (1 .. 100); print scalar %h' 33/64
:-)

Actually, I searched for a genuine use for this feature for a long time and I almost found one: Power Twool.

--
John.

Replies are listed 'Best First'.
Re^4: Perl oddities
by fergal (Chaplain) on Mar 01, 2005 at 18:19 UTC
    Oops. I completely misread your original post. I thought it was elements/buckets, not used/total. That said, given Perl's non-object data model, the only other way to provide this info would be through yet another function.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://435510]
help
Chatterbox?
[marinersk]: But I was looking for a more elegant solution. It appears noone online at this time is aware of one.
[LanX]: go to Nodelet Settings and click "All nodelets off"
[LanX]: SUPER STABLE!!!
[marinersk]: LanX++ LOL Yes, that is another workaround. :-)
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet
[marinersk]: I saw that you could post it on the Personal Nodelet, but you have to provide the content also. No way to auto-populate it. Not that this would solve my distraction problem...
[LanX]: there are template variables to "Auto-populate" it

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2017-05-29 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?