in reply to reading input
You could use Term::ReadKey too (something I always do). Sample:
use strict; use Term::ReadKey; use Data::Dumper; my @EMP_INFO; ReadMode('normal'); print "What is your name: "; push @EMP_INFO, ReadLine(0); print "What is the location name: "; push @EMP_INFO, ReadLine(0); print "What is the age: "; push @EMP_INFO, ReadLine(0); foreach (@EMP_INFO) { chomp; print $_ ."\n"; }
Please note that it's quite useles to chomp something and adding "\n" again, but this shows that if you are using this, and not directly printing the contents of @EMP_INFO, you may want to chomp the contents :)
|
|---|