Advertisement
jbonanno

words and numbers arrays

Oct 1st, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.54 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. #This creates an array of numbers called numbers.
  4. @numbers = (1,2,3,4,5,6);  
  5. #This creates an array of words called words.          
  6. @words = ("Distant", "Roads", "Are", "Coming", "And", "Going");
  7.  
  8. #These statements print out specific places within the array to get specific items.
  9. print "The 6th word is the words array is: $words[5]\n";
  10. print "The first word in the words array is: $words[0]\n";
  11. print "The last word is the numbers array is: $numbers[5]\n";
  12. print "The first word in the numbers array is: $numbers[0]\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement