The first line is there to tell the computer where the Perl interpreter is located. Perl is an interpreted language, which means that rather than compiling our programs, we use the Perl interpreter to run them. This first line is usually #!/usr/bin/perl or #!/usr/local/bin/perl, but depends on how Perl was installed on your system.
#!/usr/bin/perl print "Hello World.\n";
The second line tells the Perl interpreter to print the words 'Hello World.' followed by a newline (a carriage return). If our Perl installation is working correctly, then when we run the program, we should see the following output:
Testing your Perl installation is different depending on the type of system you are using, but we'll take a look at the two most common situations: