Exercise on subroutine

hi there,
Am new to perl. been very determined make some lines of code fromRandal l. Swartz work.
It reads:
write a subroutine named greet, that welcomes the person you name by telling them the name of the last person it greets.

like; greet('fred');

This sequence of statement should print:
Hi Fred! you are the first one here!
Hi Barney i've seen Fred
Hi Wilma i;ve seen Fred Barney
HI Betty ive seen Fred Barney Wilma.

I have folloed the tips and even implemented defined operator and state but nothing seem to work. Anyone with extensive knowledge of this should please help me with the answer.


perl_learner, show the code that doesn't work

You may wish to try asking this on StackOverflow. Also, show the code you've got so far, and try to be a bit more specific as to what problems you're having - "nothing seems to work" is a bit vague.

That's looks like the exercise from Intermediate Perl, although we use Gilligan's Island characters instead. For our books, the answers to exercises along with their explanations are in one of the appendices.

Leave a comment

About perl_learner

user-pic I blog about Perl.