http://www.perlmonks.org?node_id=976300


in reply to Find Element of array but use the next Element

Just for the sake of Another Way To Do It, here's one that doesn't have to look at array indexes:
#!/usr/bin/env perl use strict; use warnings; my @array = qw( app Oracle EPDMCA Oracle EPZXC ); my $show_next; for my $element (@array) { print "$element found\n" if $show_next; $show_next = ($element eq 'Oracle'); }