I'd be a bit worried that the second version may not perform the shifts in left to right order. There are no guarantees about the order that elements in a list are evaluated. Better would be:
sub extract { return join('-', (split(/:/, $_[0]))[1,2], $_[1]); }
In reply to Re^2: split slice?
by GrandFather
in thread split slice?
by convenientstore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |