{"id":12490,"date":"2021-11-28T18:35:36","date_gmt":"2021-11-28T18:35:36","guid":{"rendered":"https:\/\/linuxways.net\/?p=12490"},"modified":"2021-11-28T18:35:36","modified_gmt":"2021-11-28T18:35:36","slug":"how-to-install-perl-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/how-to-install-perl-on-ubuntu-20-04\/","title":{"rendered":"How to Install Perl on Ubuntu 20.04"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Perl is a programming language that is responsible for creating different algorithms. It is used for administration, GUI development and Web development.<\/p>\n<p>The Perl database interface also supports third-party databases such as Postgre, MySql, and Oracle. Markup languages like HTML also work with Perl.<\/p>\n<p>And we will guide you on how to install Perl on Ubuntu 20.04 as we did below. Hope you understand.<\/p>\n<h2>Installing Perl<\/h2>\n<p><strong>Step 1<\/strong> &#8211; Update the package<\/p>\n<p>Run:<\/p>\n<pre>$ sudo apt update<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"125\" class=\"wp-image-12491\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-545.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-545.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-545-300x36.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-545-1024x123.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-545-768x92.png 768w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<p><strong>Step 2 <\/strong>&#8211; Install Perl<\/p>\n<p>Run the apt command:<\/p>\n<pre>$ sudo apt install perl<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"170\" class=\"wp-image-12492\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-546.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-546.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-546-300x49.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-546-1024x167.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-546-768x125.png 768w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<h2>Checking Perl&#8217;s list of installed packages<\/h2>\n<p>Run the following command:<\/p>\n<pre>$ apt list --installed | grep -i perl<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"325\" class=\"wp-image-12493\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-547.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-547.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-547-300x94.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-547-1024x319.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-547-768x240.png 768w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<p>You can check its version by:<\/p>\n<pre>$ perl -v<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"310\" class=\"wp-image-12494\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-548.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-548.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-548-300x89.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-548-1024x305.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-548-768x228.png 768w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<h2>For example<\/h2>\n<p>Firstly, you create a file ending with *.pl. Here I will create a file named hello.pl:<\/p>\n<pre>$ nano hello.pl<\/pre>\n<p>Then type the following lines:<\/p>\n<pre>#!\/usr\/bin\/perl\r\n\r\nuse warnings;\r\n\r\nprint(\"Hello World!\")<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1044\" height=\"635\" class=\"wp-image-12495\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-549.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-549.png 1044w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-549-300x182.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-549-1024x623.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-549-768x467.png 768w\" sizes=\"auto, (max-width: 1044px) 100vw, 1044px\" \/><\/p>\n<p>Save and exit.<\/p>\n<p>To run:<\/p>\n<pre>$ perl hello.pl<\/pre>\n<p>Output:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1042\" height=\"66\" class=\"wp-image-12496\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550.png 1042w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550-300x19.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550-1024x65.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550-768x49.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/11\/word-image-550-1020x66.png 1020w\" sizes=\"auto, (max-width: 1042px) 100vw, 1042px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>We have shown you how to install Perl on Ubuntu 20.04.<\/p>\n<p>Thanks for referring!<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Perl is a programming language that is responsible for creating different algorithms. It is used for administration, GUI development and Web development. The Perl database interface also&hellip;<\/p>","protected":false},"author":1,"featured_media":12527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[712,100],"class_list":["post-12490","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-perl","tag-ubuntu-20-04"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=12490"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/12490\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/12527"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=12490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=12490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=12490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}