#!/usr/bin/perl # record where the __END__ starts my $pos = tell(DATA); # do stuff with it while() { print ; } # seek back to the top seek(DATA,$pos,0); # do some more stuff with it. while() { print ; } __END__ some text some more text yet some more text