{"id":12489,"date":"2015-10-01T18:08:19","date_gmt":"2015-10-01T18:08:19","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=12489"},"modified":"2015-10-01T18:08:19","modified_gmt":"2015-10-01T18:08:19","slug":"perl-qw-quote-words","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/perl-qw-quote-words\/","title":{"rendered":"Perl:  qw (quote words)"},"content":{"rendered":"<h1>The tutor brings up a neat Perl utility that you often see used in discussions between programmers.<\/h1>\n<p>There are many articles on this site about arrays.  To a newcomer, one that might be helpful is <a href=\"?p=5096\">here<\/a>.<\/p>\n<p>The point of today&#8217;s post is that, in Perl, you can create an array as follows:<\/p>\n<p><span style=\"font-family:monospace\">@furniture=(&#8220;table&#8221;,&#8221;couch&#8221;,&#8221;TV&#8221;,&#8221;desk&#8221;,&#8221;lamp&#8221;);<\/span><\/p>\n<p>However, Perl programmers usually don&#8217;t mention it that way.  They more likely write<\/p>\n<p><span style=\"font-family:monospace\">@furniture=qw(table couch TV desk lamp);<\/span><\/p>\n<p>According to <a href=\"http:\/\/www.sthomas.net\/roberts-perl-tutorial.htm\">Robert Pepper,<\/a> <span style=\"font-family:monospace\">qw<\/span> means <span style=\"font-family:monospace\">quote words<\/span>, so it reads the words as if the quotations marks and commas were there.<\/p>\n<p><span style=\"font-family:monospace\">qw<\/span> saves a lot of effort if you&#8217;re creating arrays of strings:)<\/p>\n<p>Source:<\/p>\n<p>McGrath, Mike.  <u>Perl in easy steps<\/u>.  Southam:  Computer Step, 2004.<\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tutor brings up a neat Perl utility that you often see used in discussions between programmers. There are many articles on this site about arrays. To a newcomer, one that might be helpful is here. The point of today&#8217;s &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/perl-qw-quote-words\/\"> <span class=\"screen-reader-text\">Perl:  qw (quote words)<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[191,104,1080,173,1081,1079],"class_list":["post-12489","post","type-post","status-publish","format-standard","hentry","category-computer-science","tag-array","tag-perl","tag-perl-arrays","tag-perl-programming","tag-perl-qw","tag-qw"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/12489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=12489"}],"version-history":[{"count":5,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/12489\/revisions"}],"predecessor-version":[{"id":12494,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/12489\/revisions\/12494"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=12489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=12489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=12489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}