This is how you would display “Hello World” in Perl. It’s quite similar to Bash, but note the differences carefully!
Create a text file called hello_world.pl
containing the following code:
#!/usr/bin/perl # # The traditional first program. # Strict and warnings are recommended. use strict; use warnings; # Print a message. print "Hello, World!\n";
Navigate to a directory where your hello_world.pl
is located and make the file executable:
$ chmod +x hello_world.pl
Now you are ready to execute your first perl script:
./hello_world.pl