in reply to (Ovid) Re(2): data from one subroutine into a second
in thread data from one subroutine into a second


You'll be in for a nasty surprise if you try and do that :)

He isn't reading from __DATA__ he is reading from a filehandle called DATA that he opened himself.

In which case there is no problem:

#!/usr/bin/perl -w use strict; open DATA, "+>output.txt" or die "Error message here: $!\n"; print DATA "hello, world\n"; seek(DATA, 0, 0); while (<DATA>) { print $_; } close DATA;

--
John.