Perl Variables  «Prev  Next»

Access Perl Array - Exercise Results

You Said:
Here is a solution that uses the array from the lesson.

#!/usr/bin/perl -w

# AMPAS Best Picture 1980-97

@bestpix = ( 
"Ordinary People",
"Chariots of Fire", "Gandhi",
"Terms of Endearment", "Amadeus",
"Out of Africa", "Platoon",
"The Last Emperor", "Rain Man",
"Driving Miss Daisy", "Dances with Wolves",
"The Silence of the Lambs", "Unforgiven",
"Schindler's List", "Forrest Gump",
"Braveheart", "The English Patient",
"Titanic" ); 

foreach $pic (@bestpix) { 
  print "$pic\n" 
}