Code Comments
Programming Forum and web based access to our favorite programming groups.I have a script that pauses while the reader reads the intro text, and askes them to press return to continue. At the moment I capture the input from STDIN into a variable called $waste, do nothing with it, and continue anyway. The script complains when it runs... Name "main::waste" used only once: possible typo at ./addUsers line 66. Is there a better way of doing this?
Post Follow-up to this messageSubject: capture a carriage return from <STDIN>
I have a script that pauses while the reader reads the intro text, and
askes them to press return to continue. At the moment I capture the
input from STDIN into a variable called $waste, do nothing with it, and
continue anyway. The script complains when it runs...
Name "main::waste" used only once: possible typo at ./addUsers line 66.
Is there a better way of doing this?
I don't know if it's "better" but you may wish to consider:
...
print q{To continue, please press "Enter":};
<>;
...
Post Follow-up to this messageD. J. Birkett wrote: > I have a script that pauses while the reader reads the intro text, and > askes them to press return to continue. At the moment I capture the > input from STDIN into a variable called $waste, do nothing with it, and > continue anyway. The script complains when it runs... > > Name "main::waste" used only once: possible typo at ./addUsers line 66. > > Is there a better way of doing this? Yes, don't capture the input. print 'Press return to continue.'; <STDIN>; # continue running the program John -- use Perl; program fulfillment
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.