in reply to Re^2: Parse data representing hash
in thread Parse data representing hash
Yes, splice is likely the best approach. From its documentation:
Removes the elements designated by OFFSET and LENGTH from an array [...] If LENGTH is omitted, removes everything from OFFSET onward.
So with zero-based arary indexing, it really is as simple as splice @keychain, $tabs_count;, yes.
You could also use an array slice, BTW, e.g. @keychain = @keychain[0 .. ($tabs_count - 1)];, but that's less elegant and idiomatic.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Parse data representing hash
by peterp (Sexton) on Jun 29, 2014 at 18:51 UTC | |
by AppleFritter (Vicar) on Jun 29, 2014 at 20:08 UTC |