in reply to parsing html

McA's answer is technically correct, but going down the regexp route is likely to cause you more pain further down the road.

For example, have you considered HTML where a greater-than sign legitimately occurs in an attribute?

<td title="n > 5">n greater than 5</td>

Are you aware that the </td> closing tag is optional (as per the HTML 3.2, HTML 4 and HTML 5 specs). So the following is legitimate:

<tr> <td>1 <td>2 <td>3</td> </tr>

You're better off using one of the many HTML parsing modules on CPAN which will already cover these corner cases.

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name