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:
1 2 3 4 5 6 7 8 9 10 |
#!/usr/bin/perl # # The traditional first program. # Strict and warnings are recommended. use strict; use warnings; # Print a message. print "Hello, World!\n"; |
hello_world.pl
is located and make the file executable:
1 |
$ chmod +x hello_world.pl |
1 |
./hello_world.pl |