for ($i = 1; $i <= $pop->Count(); $i++) { print "$i \n"; my $msg; $msg = $pop->HeadAndBody( $i ); my $entity = $parser->parse_data($msg); }