in reply to parsing a file

Unless you really want to for some other reason, there is really no need to add the __BEGIN__ and __END__'s.

Here is an example of processing each block of info without adding these.

#!/usr/bin/perl -w use strict; my $block; while (<DATA>) { if (!/^\n/) { $block .= $_; }else{ process($block); undef($block); } } process($block) if ($block); sub process { my $info = shift; print "\n",$info if ($info); } __DATA__ USER 1 LOGIN date MORE info MORE info USER 2 LOGIN date MORE info MORE info