Just check like:
chomp($input = <STDIN>); # get input and remove the c/r
$input = uc($input);
if ( $input eq '' or $input eq 'N') {
# nothing entered, so becomes your N
# put what you want when default is entered
}
Wags ;)
-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 20, 2001 17:07
To: [EMAIL PROTECTED]
Subject: Default variable for STDIN.
Hello All,
Just a quick question.
Just wondering how I would go about allowing a user to enter with STDIN
either a Y or a N, but have the default variable of N if the user just
hits enter.
So far I have...
print "Hit Y to continue: [N]";
$input = <STDIN>;
hmm.. something like that.
Kind Regards,
Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]