The Standard Input (`STDIN`) is a very common place for your script to receive information from a user. When running a script from a terminal or a command prompt, Anything typed in by the user while your script is running is sent to `STDIN`. When receiving data from an HTTP POST request, the data comes into the `STDIN`.
Writing a script that uses information from whatever a user types in a command prompt is straightforward - you save it in a variable.
``` perl
print "Write your name: ";
$name = <STDIN>; # user types in 'Drake' and hits the Enter key
print "Your name is $name.";
# Your name is Drake.
# <bash command prompt> _
```
As you can see, because the user hit the Enter key, `STDIN` not only received "Drake" but also the newline `\n` that would have been sent with it. If you want to get rid of that newline, an easy tool for doing so is `chomp`.
``` perl
chomp($name);
print "Your name is $name.";
# Your name is Drake.<bash command prompt> _
```
Now that you removed the newline, the command prompt now immediately shows after what you told it to print.
# Assignment
Make a Mad Lib. Prompt your user to enter nouns, verbs, adjectives, words that end in '-ing' or any other prompt you can imagine. Save your prompts into a bunch of [[NDC Coding/CSE1110 - Structured Programming I/Perl Explained#Scalar Variables in Perl|scalars]], an [[NDC Coding/CSE1110 - Structured Programming I/Perl Explained#Arrays (Lists)|array]] or a [[NDC Coding/CSE1110 - Structured Programming I/Perl Explained#Hashes (also known as Objects or Collections)|hash]]. Use what you've saved to produce a full paragraph with whatever things your user responds with.