The following script will prompt for and take user input via STDIN, place it in a variable named $input, strip away the trailing newline, and will print what the user typed in, to STDOUT.
#!/usr/bin/perl use strict; use warnings; print "Enter your input:\n"; my $input = <STDIN>; chomp $input; print "You typed: $input\n";
Dave
In reply to Re: Getting user input
by davido
in thread Getting user input
by PartyMarty
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |