Reading from standard input in perl is very simple.
print "Enter your name :";
my $name = <>;
print "Your name is $name\n";
|
The <> operator, in this case, is used to read data from the command line. It will return after a newline character is received (when the user presses enter).