Exercise 4.2: Difference between revisions

From Earlham CS Department
Jump to navigation Jump to search
Erika (talk | contribs)
New page: Return to Week 1 '''Exercise 4.2 in <i>Beginning Perl for Bioinformatics</i>''' <nowiki>#!/usr/bin/perl -w use strict;</nowiki> <nowiki> #Erika Phelps #Sept 20, 2009 #Exercise 4.2</n...
 
Erika (talk | contribs)
No edit summary
 
Line 3: Line 3:
'''Exercise 4.2 in <i>Beginning Perl for Bioinformatics</i>'''
'''Exercise 4.2 in <i>Beginning Perl for Bioinformatics</i>'''


<nowiki>#!/usr/bin/perl -w
<pre>#!/usr/bin/perl -w
use strict;</nowiki>
use strict;
<nowiki>
 
#Erika Phelps
#Erika Phelps
#Sept 20, 2009
#Sept 20, 2009
#Exercise 4.2</nowiki>
#Exercise 4.2
<nowiki>
 
#Write a program that stores an integer in a variable and prints it out.</nowiki>
#Write a program that stores an integer in a variable and prints it out.</nowiki>


<nowiki>
 
#Storing the integer
#Storing the integer
my $variable = '4';</nowiki>
my $variable = '4';


<nowiki>#Printing it out</nowiki>
<nowiki>#Printing it out


print "The variable is $variable.\n";
print "The variable is $variable.\n";


exit;
exit;</pre>

Latest revision as of 18:00, 23 September 2009

Return to Week 1

Exercise 4.2 in Beginning Perl for Bioinformatics

#!/usr/bin/perl -w
use strict;

#Erika Phelps
#Sept 20, 2009
#Exercise 4.2

#Write a program that stores an integer in a variable and prints it out.</nowiki>


#Storing the integer
my $variable = '4';

<nowiki>#Printing it out

print "The variable is $variable.\n";

exit;