No need to bother with indexes...
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11121442 use warnings; my @data = qw( 1 2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 ); my $target = 5; my $want = 0; for ( @data ) { $want-- > 0 and print "$_\n"; $_ == $target and $want = 3; }
In reply to Re: Manipulating Array Indexes
by tybalt89
in thread Manipulating Array Indexes
by TJ777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |