[sf-perl] Slinging two handles into __DATA__
Randal L. Schwartz
merlyn at stonehenge.com
Fri Oct 3 15:49:37 PDT 2008
>>>>> "yary" == yary <not.com at gmail.com> writes:
yary> I just solved my issue, but since I had this email half typed up &
yary> still have questions, thought I'd share.
yary> My goal was to have two chunks to compare in a __DATA__ section and a
yary> file handle pointing to each. I want to read from DATA and OLD_DATA as
yary> if they are separate files, interleaving reads from them, doing
yary> calculations on a lines from each, then continuing.
use Inline::Files; # from the CPAN
my @first_data = <FIRST_DATA>;
my @second_data = <SECOND_DATA>;
... rest of your code ...
first line of first data
second line of first data
first line of second data
second line of second data
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
More information about the SanFrancisco-pm