- <STDIN>
- STDIN
User Input
examples/scalars/read_from_stdin.pl
#!/usr/bin/perl use strict; use warnings; print "Enter your name, please: "; my $name = <STDIN>; print "Hello $name - how are you ?\n";
- STDIN - Standard Input (usually it is the keyboard)
- Reading one line (till ENTER) from STDIN
$ perl examples/scalars/read_from_stdin.pl Enter your name, please: Foo Hello Foo - how are you ?
There is this problem of the newline