2. Perl: get, write, run


Get (and install)
See https://www.perl.org/get.html. For Windows, I recommend Strawberry Perl.

Well, to keep it simple, for the first steps (Part 1 and Part 2), I suggest to use an online compiler like https://www.onlinegdb.com/online_perl_compiler first. At a later moment you can install Perl on your system.

Write
All your Perl programs, should have the following basic structure:


	#-------------------------------------------   
	#!/usr/bin/perl # required
	use strict; # required
	use warnings; # required
	#-------------------------------------------
	my $str = "Hello World!"; # variable
	print($str . "\n"); # variable
	#-------------------------------------------      
  1. Write always the first three lines (required), although I omit them in my code snippets for more shorter and readable code. The variable lines contain specific code.
  2. Use always my when declaring variables. In my code snippets, I omit my also.

Run
If Perl is installed, launch the command prompt on Windows or Terminal on macOS and Linux, and type the following command to execute the Perl program with extension '.pl':

perl path\perl_file.pl