# use a for loop for (@animals) { last if $_ eq 'dog'; } print "We have a dog!\n";