
{"id":5922,"date":"2011-09-16T19:33:07","date_gmt":"2011-09-16T19:33:07","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=5907"},"modified":"2011-09-16T19:33:07","modified_gmt":"2011-09-16T19:33:07","slug":"arrays-pl","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2011\/09\/16\/arrays-pl\/","title":{"rendered":"arrays.pl"},"content":{"rendered":"<h5><u> A UNIX Command <\/u><\/h5>\n<pre>\n$cat arrays.pl\n# Simple array constructs.\n@fred = (\"How\", \"are\", \"you\", \"today?\");\nprint \"\\@fred contains (@fred).\\n\";\n\n$mike = $fred[1];\nprint \"$mike $fred[3]\\n\";\n\n# The array name in a scalar context gives the size.\n$fredsize = @fred;\nprint '@fred has ', \"$fredsize elements.\\n\";\n\n# The $#name gives the max subscript (size less one).\nprint \"Max sub is $#fred\\n\";\n\n$perl arrays.pl\n@fred contains (How are you today?).\nare today?\n@fred has 4 elements.\nMax sub is 3\n$\n\n<\/pre>\n<p><\/p>\n<h5><u> UNIX Explanation <\/u><\/h5>\n<pre>\nVariables whose names begin with @ are arrays. If @sue is\nan array,  it is  different variable from  $sue. However,\nmembers   of  @sue   are  selected   by   $sue[$i].   The\nconstruction $#arrname gives the maximum subscript of the\narray @arrname.\n\n<\/pre>\n<p>source : http:\/\/sandbox.mc.edu\/~bennet\/perl\/leccode\/var2_pl.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A UNIX Command $cat arrays.pl # Simple array constructs. @fred = (&#8220;How&#8221;, &#8220;are&#8221;, &#8220;you&#8221;, &#8220;today?&#8221;); print &#8220;\\@fred contains (@fred).\\n&#8221;; $mike = $fred[1]; print &#8220;$mike $fred[3]\\n&#8221;; # The array name in a scalar context gives the size. $fredsize = @fred; print &#8216;@fred has &#8216;, &#8220;$fredsize elements.\\n&#8221;; # The $#name gives the max subscript (size less one). &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2011\/09\/16\/arrays-pl\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;arrays.pl&#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":[383,419,1246,1417,1533],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5922"}],"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=5922"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/5922\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=5922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=5922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=5922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}