#!/usr/bin/perl -w # # this is a comment use strict; sub printHello{ # sets $name to first value in argument list, $number to the 2nd in # the argument list my ($name, $number) =@_; print "Hello $name, welcome to World!\n"; return ($number*2, $number+4); } # displays prompt; reads in from STDIN to $nA, then removes last \n charactor print "Enter Your Name: "; my $nA = ; chomp($nA); print "Enter Your Age: "; my $nB = ; chomp($nB); # call the subroutine with both arguments and expect a list back # as result (2 scalars in the list) my ($returnA, $returnB) = printHello($nA, $nB); print "$returnA is first and $returnB is second\n";