Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How do i get an input when the user types on the keyboard and declare it to a string?

Replies are listed 'Best First'.
Re: Getting input from keyboard
by blazar (Canon) on May 11, 2005 at 07:18 UTC
    How 'bout my $input=<STDIN>? Or isn't it that you're interested in this faq:
    perldoc -q 'single character'
Re: Getting input from keyboard
by Ovid (Cardinal) on May 11, 2005 at 07:19 UTC

    You want to read from STDIN.

    my $data = <STDIN>; # or, if you don't want the newline at the end chomp(my $data = <STDIN>);

    Cheers,
    Ovid

    New address of my CGI Course.

Re: Getting input from keyboard
by gopalr (Priest) on May 11, 2005 at 07:23 UTC

    Using <STDIN>

    print "\nEnter Your Name : "; chomp($name=<STDIN>); print "\nYour Name is $name";
Re: Getting input from keyboard
by Anonymous Monk on May 11, 2005 at 07:53 UTC
    perldoc perlintro