Questions about this topic? Sign up to ask in the talk tab.

Perl/Basics/User Input/STDIN

From NetSec
Jump to: navigation, search

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).