in reply to split but preserve the matching pattern

You could probably do it much easier with a global match, but here's what I came up with for split:

my $a="command = adb asd 2t525 command=adfaf adsgadg asd "; my @t = map { "command" . $_ } grep { $_ ne "" } split /command/, $a; print @t;