use Data::Dumper; my $data; { undef $/; $data = ; } my @text = grep { /^\S/ } map { s/^\s+|\s+$//g; $_ } $data =~ />([^<>]+)/g; print Dumper(\@text); __DATA__ Self-Archiving E-mail Messages in Outlook The following e-mail self-archiving create an Archive folder/.pst file. See Outlook 2003 .pst file Management for instruction your messages. Select your Files (This refers to your primary...