Advertisement
jbonanno

Student arrays

Oct 1st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. #Creates an array of boy students
  4. @boyStudents = ("Sam", "Mike", "Steve", "Joe", "Jack");
  5.  
  6. #Creates an array of girl students
  7. @girlStudents= ("Samantha", "Susan", "Margaret", "Josephine");
  8.  
  9.  
  10. #Combines the arrays of boyStudents and girlStudents as studentNames
  11. @studentNames = (@boyStudents, @girlStudents);
  12.  
  13. print "The names of the students in the class are = @studentNames\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement