in reply to array manipulation

"I don't know if it is zero based like array indices are or if it is one-based"

Why don't you just try it and see?

my @foo = qw/1 2 3 4 5 6/; print "Index 1 is $foo[1]\n";
Do that, and it should be obvious :)

Update: duh, that was a really poor example, given that your question is about splice. Here is a better example:

my @foo = qw/1 2 3 4 5 6/; my @bar = splice @foo, 1,2; print "Indexes 1 & 2 are @bar\n";

Replies are listed 'Best First'.
Re^2: array manipulation
by Transient (Hermit) on Jun 15, 2009 at 16:24 UTC
    I think biohisham means the index used in the offset for the splice function. But similarly,
    perl -le 'my @arr = qw/1 2 3/; print "Removing ",splice(@arr,1,1), "\n +"; print join(" - ", @arr), "\n"'
    Does show you that it is indeed 0-based (by default).