tag:blogger.com,1999:blog-4206098438326334482.post6241135081364577575..comments2013-09-22T23:34:51.566-04:00Comments on SvOK(get_sv("main::blog", 0));: adventures in ignorance: each, keys, and valuesChas. Owenshttp://www.blogger.com/profile/11716389363199045015noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4206098438326334482.post-11597402052371641422009-08-16T02:01:41.620-04:002009-08-16T02:01:41.620-04:00You can use each in scalar context – it will retur...You can use <em>each</em> in scalar context – it will return just the key. No need for the throw-away <em>$value</em> declaration.<br /><br />Also, <em>keys</em> in void context will reset the iterator without doing anything else; this is documented behaviour. Therefore you can safely use <em>each</em> in loops that won’t ever call any code that’s not under your control – eg. simple construction of a string from the data in a hash.Aristotlehttp://www.blogger.com/profile/12315753273174946012noreply@blogger.com