by Jeremy Canfield | Updated September 27th, 2017
The following markup can be used to produce a prompt for user input in Perl.
#!/usr/bin/perl print "Enter your name: "; my $name = <STDIN>; chomp $name; print "Your name is $name";
Here is an example of running this script.
~]# ./example.pl Enter your name: Jeremy Your name is Jeremy