in reply to Read block of file and print to html table

This largely depends on how well-formed the data is. If the pattern is fairly rigid, you can do something like the following. The key is making the pattern match work properly for all records.
use strict; use warnings; my ($handle, $data); open($handle, 'data.txt'); $data = join '', <$handle>; close($handle); open($handle, '>data.html'); print $handle qq| <table cellspacing="0" cellpadding="8" border="0"><tr> <td><b>Name</b></td> <td><b>Age</b></td> <td><b>Phone</b></td>|; while ($data =~ /Name:? ?(.*?)\nAge:? ?(.*?)\nPhone:? ?(.*?)\n/igs) { print $handle qq| </tr><tr> <td>$1</td> <td>$2</td> <td>$3</td>|; } print $handle qq| </tr></table>|; close($handle);