Hello_everyone.pl

Now that we know where Perl stores command line parameters (hint: @ARGV), we can revise the original Hello world! script.

1) Write a say_hello.pl script that takes a single argument from command line, that is the name of a person, and then prints “Hello name!”.

2) Write a hello_everyone.pl script that receive as input a list of names, and then print for each name a “Hello name” line.
This means that we want to type a command like this:

perl hello_everyone.pl Lineweaver Burk

and to have, as output:

Hello Lineweaver!
Hello Burk!

3) Write a program hello_count.pl that counts the people to greet and prints the number. This means that we want to type a command like this:

perl hello_everyone.pl Lineweaver Burk 

and to have, as output:

Hello you 2 guys!

Leave a Reply

Your email address will not be published.