[Melbourne-pm] scalar(keys %foo)

Mathew Robertson mathew.blair.robertson at gmail.com
Mon Jun 1 20:06:13 PDT 2020


A question for the audience.

Does "scalar(keys %foo)" materialise the list of keys, grabs its length,
then throw away the memory?  .. or is Perl smart enough to see that
context, to understand that it just needs to count the keys ?

thx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/melbourne-pm/attachments/20200602/913dca37/attachment-0001.html>


More information about the Melbourne-pm mailing list