in reply to Read from Input
You can get input from the user by reading from "STDIN", the standard input device, which defaults to your keyboard.
You can print that input, which is now in the variable $input, with the print statement.my $input = <STDIN>;
Did you want it printed 10 times, or was that 10 kisses? ;-)print $input;
When you get input from the keyboard, you also get the newline character at the end. If you don't want that, use the 'chomp' function to get rid of it. I suggest you check out the excellent Tutorials on this site, and don't forget to use Super Search to look up more examples that you can learn from.print $input x 10;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Read from Input
by ysth (Canon) on May 07, 2004 at 15:50 UTC |