| Revision 1 (by moose, 2006/07/20 11:34:56) |
|---|
#!/usr/bin/perl use strict; use warnings; my @array; # populate array for (1..20) { push @array, $_; } # clear a few so we can find them later to repolulate undef $array[3]; undef $array[8]; undef $array[12]; my @tmp = # find all undefined items in array, and return a reference \(grep !defined, @array); # repopulate the first found cleared item ${$tmp[0]} = 456; for(@array) { print "array: $_\n"; }