{"id":21976,"date":"2023-02-21T06:46:11","date_gmt":"2023-02-21T06:46:11","guid":{"rendered":"https:\/\/www.booksofall.com\/?post_type=product&#038;p=21976"},"modified":"2023-02-21T06:46:29","modified_gmt":"2023-02-21T06:46:29","slug":"learning-perl-the-hard-way","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/","title":{"rendered":"Learning Perl The Hard Way"},"content":{"rendered":"<p>This chapter presents two of the built-in types, arrays and scalars. A scalar is a value that <a href=\"https:\/\/www.stat.berkeley.edu\/~spector\/extension\/perl\/notes\/node16.html\">Perl treats<\/a> as a single unit, like a number or a word. An array is an ordered collection of elements, where the elements are scalars.<\/p>\n<p>This chapter describes the statements and operators you need to read commandline arguments, define and invoke subroutines, parse parameters, and read the contents of files. The chapter ends with a short program that demonstrates these features.<\/p>\n<p>In addition, the chapter introduces an important concept in <a href=\"https:\/\/www.perl.org\/\">Perl<\/a>: context.<\/p>\n<p>1.1 Echo<\/p>\n<p>The<a href=\"http:\/\/www.cs.toronto.edu\/~maclean\/csc209\/unixtools.html\"> UNIX utility <\/a>called echo takes any number of command-line arguments and prints them. Here is a perl program that does almost the same thing: print @ARGV;<\/p>\n<p>The program contains one print statement. Like all statements, it ends with a semi-colon. Like all generalizations, the previous sentence is false. This is the first of many times in this book when I will skip over something complicated and try to give you a simple version to get you started. If the details are important later, we\u2019ll get back to them.<\/p>\n<p>The operand of the print operator is @ARGV. The \u201cat\u201d symbol indicates that <a href=\"https:\/\/perldoc.perl.org\/variables\/@ARGV#:~:text=variables%20%2F%20%40ARGV-,%40ARGV,%240%22%20for%20the%20command%20name.\">@ARGV<\/a> is an array variable; in fact, it is a built-in variable that refers to an array of strings that contains whatever command-line arguments are provided when the program executes.<\/p>\n<p>There are several ways to execute a Perl program, but the most common is to put a \u201cshebang\u201d line at the beginning that tells the shell where to find the program called perl that compiles and executes <a href=\"https:\/\/www.geeksforgeeks.org\/perl-basic-syntax-of-a-perl-program\/\">Perl programs<\/a>. On my system, I typed whereis perl and found it in \/usr\/bin, hence<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 700px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/perl-19jtc3ic4p?enforceShowPromotionBar=true&amp;p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":21980,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":""},"product_brand":[],"product_cat":[357],"product_tag":[],"class_list":{"0":"post-21976","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-perl","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Learning Perl The Hard Way - BooksOfAll French<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learning Perl The Hard Way - BooksOfAll French\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOfAll French\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-21T06:46:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/\",\"url\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/\",\"name\":\"Learning Perl The Hard Way - BooksOfAll French\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png\",\"datePublished\":\"2023-02-21T06:46:11+00:00\",\"dateModified\":\"2023-02-21T06:46:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png\",\"width\":\"481\",\"height\":\"679\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/fr\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Learning Perl The Hard Way\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/#website\",\"url\":\"https:\/\/www.booksofall.com\/fr\/\",\"name\":\"BooksOfAll French\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/fr\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/#organization\",\"name\":\"BooksOfAll French\",\"url\":\"https:\/\/www.booksofall.com\/fr\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/www.booksofall.com\/fr\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOfAll French\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/fr\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learning Perl The Hard Way - BooksOfAll French","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/","og_locale":"fr_FR","og_type":"article","og_title":"Learning Perl The Hard Way - BooksOfAll French","og_url":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/","og_site_name":"BooksOfAll French","article_modified_time":"2023-02-21T06:46:29+00:00","og_image":[{"url":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/","url":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/","name":"Learning Perl The Hard Way - BooksOfAll French","isPartOf":{"@id":"https:\/\/www.booksofall.com\/fr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png","datePublished":"2023-02-21T06:46:11+00:00","dateModified":"2023-02-21T06:46:29+00:00","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#primaryimage","url":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png","contentUrl":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2023\/02\/img_63f466ae09ea3.png","width":"481","height":"679"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/fr\/learning-perl-the-hard-way\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/fr\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/fr\/categories\/"},{"@type":"ListItem","position":3,"name":"Learning Perl The Hard Way"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/fr\/#website","url":"https:\/\/www.booksofall.com\/fr\/","name":"BooksOfAll French","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/fr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/fr\/#organization","name":"BooksOfAll French","url":"https:\/\/www.booksofall.com\/fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.booksofall.com\/fr\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/fr\/wp-content\/uploads\/sites\/6\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOfAll French"},"image":{"@id":"https:\/\/www.booksofall.com\/fr\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/product\/21976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/media\/21980"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/media?parent=21976"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/product_brand?post=21976"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/product_cat?post=21976"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/fr\/wp-json\/wp\/v2\/product_tag?post=21976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}