Take the following text and put it into a file called first.pl:
#!/usr/local/bin/perl
print "Hello World!\n";
Now, run it with your Perl interpreter. From a command line, go to the directory with this file and type perl first.pl. You should see: Hello World!
The \n indicates the ``newline'' character; without it, Perl doesn't skip to a new line of text on its own
Main Topics
Browse All Topics





by: sedgwickPosted on 2009-11-04 at 07:04:30ID: 25740004
Take the following text and put it into a file called first.pl:
#!/usr/local/bin/perl
print "Hello World!\n";
Now, run it with your Perl interpreter. From a command line, go to the directory with this file and type perl first.pl. You should see: Hi there!
The \n indicates the ``newline'' character; without it, Perl doesn't skip to a new line of text on its own.