Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Input/Output through the Keyboard

by peschkaj (Pilgrim)
on Nov 25, 2002 at 17:28 UTC ( #215676=note: print w/replies, xml ) Need Help??


in reply to Re^3 Input/Output through the Keyboard
in thread Input/Output through the Keyboard

eval() is part of the standard distribution of PERL.

If you wanted to allow the program to keep running until the user exits you could use something like this:

#!/usr/bin/perl $| = 1; while( ) { print "Number, plz: "; $input = <>; chomp $input; print "\nOutput is: ", ( ($input*2)-1 ), "\n"; }
That seemed to work on my system.



If you make something idiot-proof, eventually someone will make a better idiot.
I am that better idiot.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://215676]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2022-12-06 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?