Difference between revisions of "2. Print 'Hello World!'"

From Biolecture.org
imported>SeoGaLam
(Created page with "<pre> # Prints the message using two different delimeters. print "Hello, world!\n"; print qq=Did you say "Hello?"\n=;</pre>")
 
imported>SeoGaLam
 
Line 1: Line 1:
 +
<p>Save a file called hello.pl with this one line:</p>
 +
 
<pre>
 
<pre>
# Prints the message using two different delimeters.
+
<strong>print &quot;Hello World\n&quot;;</strong></pre>
print &quot;Hello, world!\n&quot;;
+
 
print qq=Did you say &quot;Hello?&quot;\n=;</pre>
+
<p>Make sure the Perl executable is on your path.</p>
 +
 
 +
<p>Now type the following command at your command prompt:</p>
 +
 
 +
<pre>
 +
<strong>perl hello.pl</strong></pre>
 +
 
 +
<p>If everything&#39;s OK, you should get the following output:</p>
 +
 
 +
<pre>
 +
<strong>Hello World</strong></pre>
 +
 
 +
<p>If not, troubleshoot.</p>
 +
 
 +
<p>&nbsp;</p>
 +
 
 +
<p><span style="font-size:18px"><strong>Reference</strong></span></p>
 +
 
 +
<hr />
 +
<p>1. <a href="http://www.troubleshooters.com/codecorn/littperl/perlhelo.htm">&quot;http://www.troubleshooters.com/codecorn/littperl/perlhelo.htm&quot;</a></p>

Latest revision as of 01:36, 7 December 2018

Save a file called hello.pl with this one line:

<strong>print "Hello World\n";</strong>

Make sure the Perl executable is on your path.

Now type the following command at your command prompt:

<strong>perl hello.pl</strong>

If everything's OK, you should get the following output:

<strong>Hello World</strong>

If not, troubleshoot.

 

Reference


1. "http://www.troubleshooters.com/codecorn/littperl/perlhelo.htm"