On Tue, Nov 10, 2009 at 14:51, Paul LeoNerd Evans <leon...@leonerd.org.uk> wrote: > So how about > > my @matches = $_[0] =~ m/^$re/ or die ....; > substr( $_[0], 0, $+[0] ) = ""; > > return @matches; > > I think I like that...
Ooh, yes, it does have a certain charm. And it may even involve less string copying -- I don't know whether s/^.....// is optimised to do that, but AFAIK substr( ..., 0, ... ) = "" will simply set the internal OFFSET flag in the SV. Cheers, Philip -- Philip Newton <philip.new...@gmail.com>