#!/usr/bin/perl use strict; use warnings; my $data = ''; print "Matches found:\n" . join (",\n", $data =~ m@(<[^>]*/>)@g) . "\n";