Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: perlapp, die, and __DATA__

by integral (Hermit)
on Apr 25, 2003 at 10:47 UTC ( #253130=note: print w/ replies, xml ) Need Help??


in reply to Re: perlapp, die, and __DATA__
in thread perlapp, die, and __DATA__

Or since @DATA isn't needed as an array this would be sufficient:

my $data = q{ line 1 line 2 line 3 }; # OR $data = <<'END'; line 1 line 2 line 3 END # to ensure a terminating newline # chomp $data; $data .= $/ print "$data";

This is as usual another way to write the first suggestion (where @data should be $data too):

@DATA = map "$_\n", split /\n/, $data; # but why add \n when you chomp + later?

--
integral, resident of freenode's #perl


Comment on Re: Re: perlapp, die, and __DATA__
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (19)
As of 2015-07-07 14:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls