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?

Replies are listed 'Best First'.
Re: How about this?
by demerphq (Chancellor) on Sep 10, 2001 at 20:00 UTC
    Oh bravo! Me and my big mouth. Yours is much better:

    my @ary = split (/\s+/,<DATA>);
    But isnt
    my @ary = split (" ",<DATA>);
    better still? :-)

    Yves
    --
    You are not ready to use symrefs unless you already know why they are bad. -- tadmc (CLPM)