{"id":497,"date":"2014-01-28T18:16:00","date_gmt":"2014-01-28T17:16:00","guid":{"rendered":"http:\/\/eiseler.synology.me\/wordpress\/?p=497"},"modified":"2014-01-28T18:16:00","modified_gmt":"2014-01-28T17:16:00","slug":"perl-array-of-arrays-when-do-i-need-to-cast","status":"publish","type":"post","link":"http:\/\/eiseler.de\/wordpress\/?p=497","title":{"rendered":"Perl: Array of Arrays, when do I need to cast"},"content":{"rendered":"<p><a href=\"http:\/\/www.caveofprogramming.com\/frontpage\/articles\/perl\/perl-array-quick-guide-to-arrays-in-perl\/#add\">Cave of Programming<\/a> gave me the hint how to cast:<\/p>\n<p>&#8220;We can use this reference with push, pop, grep and so on if we first <b>cast the reference to an actual array<\/b>. To cast a reference to an array in Perl, surround the reference with {} brackets and prefix it with the array symbol @.&#8221; And: &#8220;The {} brackets around the cast are only necessary because of the [] index brackets on the end of the array name. If we just had a simple reference by itself, we could have simply stuck a \u2018@\u2019 onto the start of it.&#8221;<\/p>\n<p>Source example looks like this:<\/p>\n<pre># Append to the first array\r\n# We need to typecast the reference to an \r\n# array before using push.\r\npush @{$stuff[0]}, &#039;kiwi&#039;;<\/pre>\n<p>Thanks!<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-497\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-497\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-497\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-pocket sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Cave of Programming gave me the hint how to cast: &#8220;We can use this reference with push, pop, grep and so on if we first cast the reference to an actual array. To cast a reference to an array in &hellip; <a href=\"http:\/\/eiseler.de\/wordpress\/?p=497\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-icon-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-497\" class=\"share-facebook sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-497\" class=\"share-twitter sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-497\" class=\"share-linkedin sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-pocket\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-pocket sd-button share-icon\" href=\"http:\/\/eiseler.de\/wordpress\/?p=497&amp;share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[27],"tags":[],"class_list":["post-497","post","type-post","status-publish","format-standard","hentry","category-perl"],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8zAuQ-81","jetpack-related-posts":[{"id":844,"url":"http:\/\/eiseler.de\/wordpress\/?p=844","url_meta":{"origin":497,"position":0},"title":"A Dockerfile for Oracle and perl","date":"27\/06\/2017","format":false,"excerpt":"I didn'f find a dockerfile for oracle and perl. So I did one by myself. Quick Instructions: Create dir; Create Dockerfile (above); create oracle_test.pl (above), download the oracle files. Build it: docker build -t perl-oracle . Run it: docker run -it --rm perl-oracle I took http:\/\/www.ecliptik.com\/Containerizing-a-Perl-Script\/ as the base and\u2026","rel":"","context":"In &quot;Docker&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":479,"url":"http:\/\/eiseler.de\/wordpress\/?p=479","url_meta":{"origin":497,"position":1},"title":"Raspberry Pi mit Internetradio und Airplay","date":"30\/11\/2013","format":false,"excerpt":"Hier der einige Tipps zum Aufbau eines Raspberry Pis ohns Monitor, Tastatur und Maus mit den F\u00e4higkeiten remote eine Oberfl\u00e4che bereit zu stellen, Internetradio wieder zu geben und als Airplay Station zu dienen. Achso und nebneher noch einen Webserver (LAMP) laufen lassen. Was braucht man? Raspberry Pi, Stromversorgung dazu, WLAN-Stick,\u2026","rel":"","context":"In &quot;iOS App&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":12,"url":"http:\/\/eiseler.de\/wordpress\/?p=12","url_meta":{"origin":497,"position":2},"title":"iLOE\u2018s back in town","date":"30\/06\/2011","format":false,"excerpt":"Today apple reviewed the new iLOE Version 1.9.4 so I could put it back in the store. If you are interested in iOS programming what happened? If you use a class from a external lib just in a xib there seems to be a chance that the compiler\/linker while optimizing\u2026","rel":"","context":"In &quot;iOS App&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":503,"url":"http:\/\/eiseler.de\/wordpress\/?p=503","url_meta":{"origin":497,"position":3},"title":"G\u00fcnstig Temperatur, Luftfeuchte und Energie messen mit Raspberry Pi oder PC","date":"19\/03\/2014","format":false,"excerpt":"Drahtloses Anbinden von Temperatursensoren und Energiemesser. Und das noch g\u00fcnstig. Sehr hilfreich war dieser Beitrag. Er beschreibt die Anbindung von drahtlosen Sensoren an Fhem. Fhem wollte ich jetzt (noch) nicht aufsetzen, deshalb realisierte ich meine eigene Anbindung in der die Temperaturkurven auf dem Webserver des Raspi angezeigt werden. Zutaten: Ein\u2026","rel":"","context":"In &quot;Arduino&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/eiseler.de\/wordpress\/wp-content\/uploads\/2020\/08\/Bildschirmfoto-2020-08-18-um-03.09.47.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":432,"url":"http:\/\/eiseler.de\/wordpress\/?p=432","url_meta":{"origin":497,"position":4},"title":"Just a short test of the Grove I2C Color Sensor","date":"03\/11\/2013","format":false,"excerpt":"Just made a short test of the grove color sensor. Tested some Lego. Red, green and blue works well as you can see, but didn't manage to measure the difference between red, orange and yellow. Here is the short movie: http:\/\/www.youtube.com\/watch?v=wJNKoKqLqFA And here the source: \/* Groove Color Sensor and\u2026","rel":"","context":"In &quot;Arduino&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/img.youtube.com\/vi\/wJNKoKqLqFA\/0.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":856,"url":"http:\/\/eiseler.de\/wordpress\/?p=856","url_meta":{"origin":497,"position":5},"title":"Pok\u00e9mon GO Plus, lost connection","date":"06\/08\/2017","format":false,"excerpt":"Your Pok\u00e9mon GO Plus doesn't work anymore or lost connection? Had to figure this out by myself: After connection (found in instructions) you'll find the Pok\u00e9mon GO Plus Symbol in the map screen. Now: If it's red, your Pok\u00e9mon GO Plus is connected and works. If it is like greyed\u2026","rel":"","context":"In &quot;Gadgets&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=497"}],"version-history":[{"count":2,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":499,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/497\/revisions\/499"}],"wp:attachment":[{"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/eiseler.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}