develooper Front page | perl.beginners | Postings from February 2009

Acepting default value for user input

Thread Next
From:
Sarsamkar, Paryushan
Date:
February 27, 2009 07:03
Subject:
Acepting default value for user input
Message ID:
58D439F76B2B6B4888EE8E8D9CB8D2110D3346F5@HQ-MAIL3.ptcnet.ptc.com
Hi All,

 

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] : 

Do you want to do something strange, tedious, and/or risky? [no] :

What you want as your return address? [you@there] :

...

 

 

Thanks,

Paryushan

 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About