#!/usr/bin/perl use strict; use warnings; # quoted word list assigned to array my @animals = qw/aligator beaver cat dog elephant frog giraffe hamster iguana jaguar kangaroo leopord monkey/; # assign list which includes a list plus 3 more quoted words @animals = (@animals, "narwhal", "owl", "parrot"); # arrays in boolean context return false when they are empty while (@animals) { # assign the first element to the left hand side and delete it from the array my $animal = shift @animals; print "$animal\n"; }