http://www.perlmonks.org?node_id=995
   1: # prompt for and read First and Last name, then print a welcome message.
   2: 
   3: print "\nWhat is your first name? ";
   4: my $first = <>;
   5: 
   6: print "\nWhat is your last name? ";
   7: my $last = <>;
   8: 
   9: chomp $first; # strip the newline from the first name
  10: 
  11: print "Welcome $first $last";

go back to Basic I/O Exercises