in reply to parsing a file

You could use a regex to grab each set of everything between __BEGIN__ and __END__.

# untested my @users = ( $file =~ /__BEGIN__\n(.*?)\n__END__/gs );

But if I may make a reccomendation, for dealing with this kind of data, I find YAML to be extremely useful and eady.