sub wierd_split (\@@) { my $regex = shift; local $_ = @_ ? shift : $_; my @res; ($res [@res], $_) = split shift @$regex, $_, 2 while @$regex && length; push @res => $_ if length; @res } print "Got $_\n" for wierd_split @{[':', '::', '\s+']} => 'foo:bar::baz frog'; __END__ Got foo Got bar Got baz Got frog