jbonanno icon

words and numbers arrays

jbonanno | PRO | 10/02/17 04:48:24 AM UTC | 0 ⭐ | 238 👁️ | Never ⏰ | []
Perl |

540 B

|

None

|

0 👍

/

0 👎

#!/usr/bin/perl
 
#This creates an array of numbers called numbers. 
@numbers = (1,2,3,4,5,6);  
#This creates an array of words called words.           
@words = ("Distant", "Roads", "Are", "Coming", "And", "Going");
 
#These statements print out specific places within the array to get specific items.
print "The 6th word is the words array is: $words[5]\n";
print "The first word in the words array is: $words[0]\n";
print "The last word is the numbers array is: $numbers[5]\n";
print "The first word in the numbers array is: $numbers[0]\n";

Comments