Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Input/Output through the Keyboard

by pg (Canon)
on Nov 13, 2002 at 06:19 UTC ( #212500=note: print w/replies, xml ) Need Help??


in reply to Input/Output through the Keyboard

(Looks like the server is not working properly at this moment, it is not taking posts, try again).I cooked a little bit:
while (<STDIN>) { chomp; if ($_ eq "quit") { exit; } print eval "$_", "\n"; }
Sample input output would be: (user in put in red, output in blue):
$a=2
2
$a+3
5
($a+5)*2
14
quit

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-12-09 00:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?