And if you need steps different than one? Non-linear? :)

R.

On 2/24/12 12:01 AM, sawyer x wrote:
> On Fri, Feb 24, 2012 at 9:41 AM, Stefan Hornburg (Racke) <[email protected]
> <mailto:[email protected]>> wrote:
>
>
>     How do you write for loops without C-style where you need a running
>     index inside the loop code?
>
>
> Simple:
> foreach my $idx ( 0 .. $#array ) {
>       print $array[$idx], "\n";
> }
>
>
>
> _______________________________________________
> Perl mailing list
> [email protected]
> http://mail.perl.org.il/mailman/listinfo/perl

_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to