Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to splice an array through a variable that gets processed/cleaned. However, I have found out that the following pieces of code are not equivalent.
is not equal to...but gets a runtime errorprint @array[2,3..7];
Which returns:my $splice_str = '2,3..7'; print @array[$splice_str];
Any ideas?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Splicing an array.
by nuance (Hermit) on Aug 13, 2000 at 06:37 UTC | |
by eduardo (Curate) on Aug 13, 2000 at 08:16 UTC | |
by Kozz (Friar) on Aug 13, 2000 at 08:18 UTC | |
|
Re: Splicing an array.
by reptile (Monk) on Aug 14, 2000 at 02:44 UTC |