{"id":37114,"date":"2019-02-18T23:38:57","date_gmt":"2019-02-18T23:38:57","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=37114"},"modified":"2019-02-18T23:44:34","modified_gmt":"2019-02-18T23:44:34","slug":"perl-ternary-operator","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/perl-ternary-operator\/","title":{"rendered":"Perl: ternary operator"},"content":{"rendered":"\n<h2>Perl self-tutoring: the tutor mentions the ternary operator.<\/h2>\n<p>\nLet&#8217;s imagine the variable $v0 is not defined, and therefore false from Perl&#8217;s point of view.\n<\/p><p style=\"font-family:monospace;font-size:120%\">\n$v0 ? print &#8216;defined&#8217; : print &#8216;not defined&#8217;\n<\/p>\n<p>will output <em>not defined<\/em>.<\/p>\na?b:c is known as the ternary operator. If a is true, then b happens; else, c.\n<\/p>\n<p>\nSource:\n<\/p>\n<p>\n<a href=\"https:\/\/perlmaven.com\/the-ternary-operator-in-perl\">perlmaven.com<\/a><\/p>\n<p>\n<a href=\"http:\/\/www.sthomas.net\/roberts-perl-tutorial.htm\/ch5\/The_Truth_According_to_Perl\">roberts perl tutorial<\/a><\/p>\nJack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.\n","protected":false},"excerpt":{"rendered":"<p>Perl self-tutoring: the tutor mentions the ternary operator. Let&#8217;s imagine the variable $v0 is not defined, and therefore false from Perl&#8217;s point of view. $v0 ? print &#8216;defined&#8217; : print &#8216;not defined&#8217; will output not defined. a?b:c is known as &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/perl-ternary-operator\/\"> <span class=\"screen-reader-text\">Perl: ternary operator<\/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":[2943],"tags":[],"class_list":["post-37114","post","type-post","status-publish","format-standard","hentry","category-perl"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/37114","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=37114"}],"version-history":[{"count":6,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/37114\/revisions"}],"predecessor-version":[{"id":37122,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/37114\/revisions\/37122"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=37114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=37114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=37114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}