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 :)
--
b10m
All code is usually tested, but rarely trusted.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.