in reply to Re^2: split slice?
in thread split slice?

Nice. As a finishing touch, you could indicate to split to produce only 4 elements: 0 to 2, and the rest of the string in the last element to be sliced away.

sub extract { return join('-', (split(/:/, $_[0], 4))[1,2], $_[1]); }

• another intruder with the mooring in the heart of the Perl