Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

How about this?

by Rhose (Priest)
on Sep 10, 2001 at 18:46 UTC ( [id://111470]=note: print w/replies, xml ) Need Help??


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)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://111470]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found