Sarsamkar, Paryushan wrote:
I would like to accept some user inputs (using <STDIN>), but it might be
easier for a user if I can provide the default value, so that they just
have to press ENTER.

How can I do that? I've played around with <STDIN> but I cannot make it
work exactly as I'd like.


E.g.
Do you want to do the normal thing? [yes] :

    print 'Do you want to do the normal thing? [yes] : ';
    chomp( my $normal = <STDIN> );
    $normal ||= 'yes';

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to