
{"id":6218,"date":"2011-11-08T19:09:02","date_gmt":"2011-11-08T19:09:02","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=6218"},"modified":"2011-11-08T19:09:02","modified_gmt":"2011-11-08T19:09:02","slug":"hashes-pl-hash-related","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/11\/08\/hashes-pl-hash-related\/","title":{"rendered":"hashes.pl    %(hash related)"},"content":{"rendered":"<h5><u> A UNIX Command <\/u><\/h5>\n<pre>\n$cat hashes.pl\n# Simple hash constructs\n$fred{\"with\"} = \"without\";\n$fred{\"this\"} = \"that\";\n$fred{\"mountain\"} = \"valley\";\n$fred{\"left\"} = \"right\";\nprint qq\/$fred{\"this\"}n\/;\n@keys = keys(%fred);\nprint \"Keys are @keysn\";\n\n# Initializer for %yard.\n%yard = ( red =&gt; 'brick',\n          blue =&gt; 'sky',\n          green =&gt; 'grass',\n          yellow =&gt; 'dandelion' );\nprint \"$yard{'blue'} $yard{'yellow'}n\";\n\n$perl hashes.pl\nthat\nKeys are left mountain with this\nsky dandelion\n$\n\n\n<\/pre>\n<p><\/p>\n<h5><u> UNIX Explanation <\/u><\/h5>\n<pre>\nVariables  whose   names  begin  with  %  are   hashes,  which  are\nessentially arrays subscripted by  strings. As with arrays, %sue is\na hash, and it is a different variable from $sue, though members of\n%sue are  selected by  $sue{$s}.  The built-in  function keys(%sue)\nreturns an array of all the keys (subscripts) of the hash %sue.\n\n<\/pre>\n<p>http:\/\/sandbox.mc.edu\/~bennet\/perl\/leccode\/var3_pl.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A UNIX Command $cat hashes.pl # Simple hash constructs $fred{&#8220;with&#8221;} = &#8220;without&#8221;; $fred{&#8220;this&#8221;} = &#8220;that&#8221;; $fred{&#8220;mountain&#8221;} = &#8220;valley&#8221;; $fred{&#8220;left&#8221;} = &#8220;right&#8221;; print qq\/$fred{&#8220;this&#8221;}n\/; @keys = keys(%fred); print &#8220;Keys are @keysn&#8221;; # Initializer for %yard. %yard = ( red =&gt; &#8216;brick&#8217;, blue =&gt; &#8216;sky&#8217;, green =&gt; &#8216;grass&#8217;, yellow =&gt; &#8216;dandelion&#8217; ); print &#8220;$yard{&#8216;blue&#8217;} $yard{&#8216;yellow&#8217;}n&#8221;; $perl hashes.pl &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/11\/08\/hashes-pl-hash-related\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;hashes.pl    %(hash related)&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6218"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=6218"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/6218\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=6218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=6218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=6218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}