{"id":4832,"date":"2014-07-03T20:10:27","date_gmt":"2014-07-03T20:10:27","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=4832"},"modified":"2014-07-03T20:10:27","modified_gmt":"2014-07-03T20:10:27","slug":"perl-programming-the-shebang-line","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/perl-programming-the-shebang-line\/","title":{"rendered":"PERL programming:  the &#8220;shebang&#8221; line"},"content":{"rendered":"<h1>Tutoring PERL beginnings, the details can be so important.\u00a0 While the tutor now focuses to the Linux\/Mac side, Windows users might do well to tune in.<\/h1>\n<p>Over my last few posts I&#8217;ve been discussing how to get started with PERL programming.\u00a0 Of course, I&#8217;ve run parallel posts:\u00a0 some have focused on Windows, others on Linux\/Mac.\u00a0 I hope you&#8217;ve all been successful in following the procedures I&#8217;ve offered.<\/p>\n<p>Whichever world you reside in &#8211; assuming it is just one &#8211; knowing what&#8217;s going on in the other world often seems beneficial.\u00a0 Therefore, I recommend the users of one operating system read the posts for the other, if only to realize how similar the procedures are.<\/p>\n<p>Today&#8217;s emphasis is on the line<\/p>\n<p><span style=\"color: brown;font-style:monospace\">#!\/usr\/bin\/perl<\/span><\/p>\n<p>which is part of the script for Linux\/Mac, but is conspicuously absent at the head of the script for Windows.<\/p>\n<p>According to <a href=\"http:\/\/www.sthomas.net\/roberts-perl-tutorial.htm\">Robert Pepper&#8217;s Perl Tutorial<\/a>, <span style=\"color: brown;font-style:monospace\">#!\/usr\/bin\/perl<\/span> is called the &#8220;shebang&#8221; line.  (By the way:  almost everything I know about PERL I learned from Robert Pepper.) He goes on to explain that under Unix systems (Linux is a derivative), the shebang line tells the file type so the computer knows how to execute it.  <\/p>\n<p>Windows, he continues, does not need a shebang line.  However, a shebang line for the Windows script might look similar to this:<\/p>\n<p><span style=\"color:brown;font-style:monospace\">#!c:\/strawberry\/perl\/bin\/perl.exe<\/span><\/p>\n<p>(The above shebang reveals the use of Strawberry Perl).<\/p>\n<p>The line tells the location of the perl interpreter, which will execute the script.  Once again, the line is not needed in Windows.<\/p>\n<p>For Linux\/Mac, however, you will see something like<\/p>\n<p><span style=\"color: brown;font-style:monospace\">#!\/usr\/bin\/perl<\/span><\/p>\n<p>at the head of a PERL script, and it <em>is<\/em> needed &#8211; on mine, anyway.  Now you know why, whichever operating system you might use:)<\/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>Tutoring PERL beginnings, the details can be so important.\u00a0 While the tutor now focuses to the Linux\/Mac side, Windows users might do well to tune in. Over my last few posts I&#8217;ve been discussing how to get started with PERL &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/www.oracletutoring.ca\/blog\/perl-programming-the-shebang-line\/\"> <span class=\"screen-reader-text\">PERL programming:  the &#8220;shebang&#8221; line<\/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":[167,104,168,177,175,176],"class_list":["post-4832","post","type-post","status-publish","format-standard","hentry","category-computer-science","tag-getting-started-with-perl","tag-perl","tag-programming-with-perl","tag-shebang-line","tag-tutor","tag-tutoring"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/4832","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=4832"}],"version-history":[{"count":32,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/4832\/revisions"}],"predecessor-version":[{"id":4864,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/4832\/revisions\/4864"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=4832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=4832"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=4832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}