{"id":41282,"date":"2021-03-31T21:05:24","date_gmt":"2021-03-31T21:05:24","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=41282"},"modified":"2021-03-31T21:05:25","modified_gmt":"2021-03-31T21:05:25","slug":"perl-if-with-undefined-variable","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/perl-if-with-undefined-variable\/","title":{"rendered":"Perl: if with undefined variable"},"content":{"rendered":"\n<h2>Self-tutoring about comp-sci: the tutor mentions Perl&#8217;s reaction to if(var), var undefined.<\/h2>\n<p>\nIn <a href=\"https:\/\/www.oracletutoring.ca\/blog\/computer-science-lisp-ideas-about-true-and-false\/\">yesterday&#8217;s post<\/a> I mention about LISP and its reaction to a few &#8220;if&#8221; situations. In particular, LISP won&#8217;t tolerate being asked &#8220;if&#8221; about an undefined variable.<\/p>\n<p>LISP, to be sure, allows a &#8220;no-holds-barred&#8221; programming style. So does Perl, but Perl seems less delicate. For instance, if($var) is &#8220;false&#8221; in Perl when $var=0 or even if $var has never been declared. Otherwise it&#8217;s true. Such is my experience, anyway.<\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Self-tutoring about comp-sci: the tutor mentions Perl&#8217;s reaction to if(var), var undefined. In yesterday&#8217;s post I mention about LISP and its reaction to a few &#8220;if&#8221; situations. In particular, LISP won&#8217;t tolerate being asked &#8220;if&#8221; about an undefined variable. LISP, &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/perl-if-with-undefined-variable\/\"> <span class=\"screen-reader-text\">Perl: if with undefined variable<\/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":[],"class_list":["post-41282","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41282","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=41282"}],"version-history":[{"count":2,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41282\/revisions"}],"predecessor-version":[{"id":41284,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/41282\/revisions\/41284"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=41282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=41282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=41282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}