This script will show how to read numbers from keyboard and find the sum.If some value is entered say 999 then it will exit the program.
#!/usr/bin/perl
print "Enter the number \n";
$userinput = <STDIN>;
chomp ($userinput);
print "User typed $userinput\n";
while ($userinput != 999) {
$sum=$sum+$userinput;
print "The SUM is $sum\n";
print "Enter the number again \n";
$userinput = <STDIN>;
chomp ($userinput);
}
print "Typed 999, So exiting\n";
Incoming search terms:
- perl input from keyboard (20)
- perl keyboard input (8)
- accepting values from keyboard in perl (7)
- how to take input from keyboard in perl (6)
- perl get input from keyboard (5)
- read a value from keyboard in perl (4)
- how to read values from keyboard in perl (4)
- Write a PERL program to input 10 numbers using keyboard (4)
- perl read input from keyboard (3)
- perl reading keyboard input (3)
- sum perl (3)
- perl:how to dispay sum of twi inputted numbers (3)
- how to give input from keyboard in perl (2)
- how to accept input from keyboard in perl (2)
- Reading values from keyboard in perl (2)
- how to read a value from keyboard in perl (2)
- javascript sum tutorial (2)
- perl script change keyboard (2)
- reading input from keyboard in perl (2)
- how to read value from keyboard in javascript (2)
- perl script keyboard input (2)
- perl wait for keyboard input (2)
- how to give keyboard input in perl (2)
- how to give input from keyboard in javascript (2)
- read input from keyboard in perl (2)
- perl sum input (2)
- input from keyboard in php example (2)
- keyboard input in perl (2)
- how to take input from the keyboard and find sum of values in sql (2)
- get number from keyboard perl (2)
- perl program to find sum of n numbers (2)
- perl program to read from keyboard (2)
- php program to read a value through keyboard (2)
- perl program to compute sum of n numbers (2)
- how to read input from keyboard in perl (2)
- how to read the values from keyboard in javascript (2)
- perl program for sum of n numbers (2)
- accepting values from keyboard in perl script (2)
- taking input values from keyboard in perl (2)
- accepting value through keyboard in perl (2)
You will also be interested in ,
- Commenting Multi Lines In Perl Script
- How to run CGI or Perl Scripts in IBM Http Server [IHS] or Apache Servers
- Embedding html in perl, how to do that?
- Simple User Input And Sleep Functionality Using Perl Script
- Determine the date using perl
- Simple webpage redirection using perl script
- Connect to mysql using perl in xampp
- Simple Perl Module Script
- Split /etc/passwd file using perl script

