Perl Learning - 7 (strict/warnings, return a list, & usage)
4. Write a sub greet(), use the given name as argument, print the welcome words and tell him the name who came before him. greet ("Fred");greet ("Barney");
should print:
Hi Fred! You are the first one here!
Hi Barney! Fred is also here!
#!/usr/bin/perl
sub greet{
chomp(my $name=$_);
push @names,$name;
while($index
页:
[1]