Not entirely clear what you want... so I'm guessing a bit.
#!/usr/bin/env perl5.22.1
use strict;
use warnings;
use 5.10.1;
my $x ="aaa bbb ccc dd ee ff dd TAG=lls foo TAG=some randome tag TAG=l
+ast_tag";
#my $x ="TAG=lls foo TAG=some randome tag TAG=last_tag";
my @tags = split /\s*TAG=/, $x;
# before the first TAG, discard.
shift @tags;
my $i = 0;
say "tag ", $i++, ": [$_]" for @tags;
and the output is:
tag 0: [lls foo]
+
tag 1: [some randome tag]
tag 2: [last_tag]
Is that what you're looking for?