in reply to Find Element of array but use the next Element
#!/usr/bin/perl use strict; use warnings; my @arr = ('app', 'Oracle', 'EPDMCA', 'Oracle' ,'EPZXC'); while (my($index,$value) = each @arr ) { if($value eq "Oracle") { print "Value next to Oracle is:$arr[$index+1]\n" } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find Element of array but use the next Element
by afoken (Chancellor) on Jun 15, 2012 at 20:43 UTC |