0 Replies - 620 Views - Last Post: 12 November 2014 - 08:17 AM

#1 ajzimme  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 16-October 14

Input 3 numbers from user prompt

Posted 12 November 2014 - 08:17 AM

#!/usr/bin/perl
print ("Enter the 1st number: ");
$num1 = <STDIN>;
print ("Enter the 2nd number: ");
$num2 = <STDIN>;
print ("Enter the 3rd number: ");
$num3 = <STDIN>;
print $num1;
print $num2;
print $num3;


So far I have the above, I would like to make this more efficient. I know I can have $num[count], how would I put it into a loop so it puts the numbers into an array?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1