http://www.perlmonks.org?node_id=111470


in reply to Getting data out of __DATA__ and __END__

I don't know if this is the "least resource-intensive" method, but it does seem to do what you requested. Please note that blank lines are not added to the array.

use strict; #-- Change the end of record character to read the whole file. undef $/; #-- Create the array my @ary = split (/\s+/,<DATA>); print join(" / ", @ary); __DATA__ boop noop boop crep a1 a2 a3 a4 a5 b1 b2 c1 c2 c3 c4 d1 d2 d3

Is this what you wanted?