Perl - hello world

How to Run a Hello World Script using Perl

This short tutorial is a guide to help familiarize you with writing a simple Hello World script using Perl.

1) With Ubuntu running on your virtual machine, open the Terminal window.

2) Create a file using pico by entering the command

pico perltest

3) To create a hello world script simply type the following line:

print “Hello World! \n”;

4) Save the file by pressing CTRL+O and leave the file name as is

  • Press Enter.

  • Exit the file window by pressing CTRL+X.

4) Now that your helloworld script is created, run the file by entering the command ‘perl perltest’

5) Congratulations, you have successfully created and ran a helloworld script using perl!