Probably, the list for looping is populated before the loop starts? How will it work with large amounts of data?#!/usr/bin/perl use strict; use warnings; my %h = ( 1 => 1111111, 2 => 2222222, 3 => 3333333, 4 => 4444444, 5 => 5555555, ); foreach (sort keys %h) { print "Processing $_\n"; my $new = $_*10; $h{$new} = $new; print " Addding $new\n"; next; } exit;
--dda
In reply to foreach loop question by dda
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |