Due on Jan. 20th 5:00PM If you do not have experience to use perl, please do the following instructions. If you know how to program in perl, please go to the next page.

helmetpastoralSoftware and s/w Development

Dec 13, 2013 (3 years and 5 months ago)

60 views

BIOS 897
-
2

Quiz 2: hello
perl
!

Due on Jan. 20th 5:00PM


If you do not have experience to use perl, please do the following instructions.

If you know how to program in perl, please go to the next page.



(1) To download perl

For Mac OS and Linux, please dow
nload from
http://www.perl.org/

For MS Windows,
please

download ActivePerl from
http://www.activestate.com/activeperl



(2) To install perl

You need follow the instructi
on for installation.


(3) To edit your first perl script file (source code)

For MS Windows, you may use “notepad” or other editors, such as “ultraedit”
(
http://www.ultraedit.com/

unfortunately, this software is not
free.)

For Ma
c OS, you may use
TextEdit
, vi or emacs.


Please type the following lines, and save it as “mycode.pl”.



use strict;

print "Hello World
\
n";



(4) To execute your script

For MS Windows,
once
you install perl and restart your computer

into Win
dows, bring up a
DOS window. (Do you know how to open that black window for DOS?)

For Mac OS
,
you need open a consol or terminal window.


Then, change your directory to

the directory

that save
s

your file of “hello.pl”
. Type the following
command:


perl he
llo
.pl




To submit your answers to this quiz, please describe what you did and what you got. You also
need to submit your source code. Please list your name, the goal of this source code, the date you
made it with comments. (Do you know how to insert a li
ne of comments in perl scripts? A good
style for programming is inserting enough comments for other readers to understand your codes.)

And answer the following questions:

(1)

Do you feel it is easy or difficult to finish the above steps?

(2)

What does “
\
n” work f
or in the last line?

(3)

Please list all data structures you heard or used before? For example, string, array, list,
hash table, queue, stack, tree etc.








If you already have experience in perl programming, please answer the following questions:

(1)

What vers
ion are you using for perl
?

(2)

What editor or development environment do you used to edit perl source code?

(3)

Please list all data structures you heard or used before? For example, string, array, list,
hash table, queue, stack, tree etc.

(4)

How many lines did you
program for the largest project you worked on?

(5)

Please briefly describe your style for writing comments while you were programming.