in reply to merging arrays
I guess it's not merging that you want so much as slicing You were closeish, but the interpolation was not helping at all. Try this:
use strict; use warnings; my $pics_to_find = 3; my @found_images = (1, 2, 3, 4, 5); my @saved_images = @found_images[0 .. $pics_to_find - 1]; print "@saved_images";
Prints:
1 2 3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: merging arrays
by Anonymous Monk on Jun 24, 2006 at 04:49 UTC | |
by GrandFather (Saint) on Jun 24, 2006 at 04:58 UTC | |
by shmem (Chancellor) on Jun 24, 2006 at 11:52 UTC |