Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Getting data out of __DATA__ and __END__

by demerphq (Chancellor)
on Sep 10, 2001 at 19:18 UTC ( [id://111487]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub test {
       local $\="NEWLINE" if 1;
    ...
       }
       print "text:";
    }
    
  2. or download this
    # This works.
    my @ary;
    ...
    my (@ary);
    @ary = split (" ",$str) while (my $str=<DATA>);
    print join(" / ", @ary);
    
  3. or download this
    my @words = map { split " ",$_ } <DATA>;
    print "@words\n";
    
  4. or download this
    $/=" ";
    my @words=<DATA>;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found