{"id":39312,"date":"2020-05-06T21:31:41","date_gmt":"2020-05-06T21:31:41","guid":{"rendered":"https:\/\/www.oracletutoring.ca\/blog\/?p=39312"},"modified":"2020-05-06T21:31:42","modified_gmt":"2020-05-06T21:31:42","slug":"comp-sci-perl-vs-c-command-line-arguments","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-perl-vs-c-command-line-arguments\/","title":{"rendered":"Comp sci: Perl vs C: command-line arguments"},"content":{"rendered":"\n<h2>Self-tutoring about computer science: the tutor notices a difference he finds surprising between Perl and C.<\/h2>\n<p>\nToday, my finding is that, with the command-line program call\n<\/p>\n<p>perl f1.pl Hello!<\/p>\n<p>Hello! is the zeroth command line argument ($ARGV[0]). I wouldn&#8217;t have thought so, yet it seems to be true.<\/p>\n<p>In C, though, the command-line program call<\/p>\n<p>.\/f1 Hello!<\/p>\n<p>considers Hello! as the argv[1] (which is what I&#8217;d expect).<\/p>\n<p>How Perl and C differ in this way I find very surprising, and barely believe it. However, my experience today suggests it&#8217;s true.<\/p>\n<p>Source:<\/p>\n<p><a href=\"https:\/\/www.cyberciti.biz\/faq\/howto-pass-perl-command-line-arguments\/\">cyberciti.biz<\/a><\/p>\n\n<p>Kernighan, Brian W. and Dennis Ritchie. <em>The C Programming Language<\/em>. New Jersey: Prentice Hall, 1988.<\/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>Self-tutoring about computer science: the tutor notices a difference he finds surprising between Perl and C. Today, my finding is that, with the command-line program call perl f1.pl Hello! Hello! is the zeroth command line argument ($ARGV[0]). I wouldn&#8217;t have &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/comp-sci-perl-vs-c-command-line-arguments\/\"> <span class=\"screen-reader-text\">Comp sci: Perl vs C: command-line arguments<\/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-39312","post","type-post","status-publish","format-standard","hentry","category-computer-science"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/39312","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=39312"}],"version-history":[{"count":2,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/39312\/revisions"}],"predecessor-version":[{"id":39314,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/39312\/revisions\/39314"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=39312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=39312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=39312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}