|
|
| Welcome to the Monastery | |
| PerlMonks |
Re^2: Storing multiple blocks of text in the __DATA__ sectionby blindluke (Hermit) |
| on Jan 03, 2015 at 14:35 UTC ( [id://1112057]=note: print w/replies, xml ) | Need Help?? |
|
Thank you for taking the time to reply, and providing all those suggestions. Ad 1: Noted. I expect that due to this behavior, even if I wanted interpolation, it would still be better ( in terms of style) to write <<"ENDS" to make the fact (that I am aware of this) explicit. Ad 2&3: Excellent stuff, I was not aware of this possibility (multiple here-docs in the same line). Thank you! Ad 4: Very interesting. I assume that the danger associated with grep is the fact that it will remove both undef (as intended) and anything that evaluates as non-true (could pose a problem). Is there any other danger involved? Not that it would matter much, as your solution is definitely better, but I'm just curious. Ad 5: Slurping __DATA__ is exactly what I had in mind when asking about possible split usage. - Luke
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||