You are here: >


standard inputShort for standard input, stdin is an input stream where data is sent to and read by a program. It is typically used in Unix operating systems and with certain programming languages such as C, Perl, and Java. Below, is an example of how STDIN could be used in Perl.

print "Type something: ";
my $example = <STDIN>;
print "\nYou typed: $example\n";

In the above example, when ran the script would ask you to type something. Whatever is typed is saved in the $example variable and then printed as "You typed: xxxx", where xxxx is what is saved in the variable.

Also see: Input, Programming terms