#!/usr/bin/perl -w use Text::Balanced qw (extract_tagged); use strict; my $text = " for some trailing text"; my @a = extract_tagged ($text); print scalar (@a), "\n"; print "$_\n" for (@a); exit 0;