From: Xavier Noria Date: 2008-02-10T05:55:29+09:00 Subject: Re: array of here documents On Feb 9, 2008, at 12:04 PM, Mark Woodward wrote: > On Fri, 8 Feb 2008 18:17:28 -0500 > Xavier Noria wrote: > >> On Feb 9, 2008, at 12:09 AM, Roger Pack wrote: >> >>> Question: is it possible to create an array of here documents? >>> a = [<>> some stuff >>> more stuff >>> END, >>> <>> even more >>> END >>> ] >>> >>> >>> ? >> >> Yup: >> >> a = [<> some stuff >> more stuff >> FOO >> even more >> BAR >> > > Is there any reason you wouldn't set up the heredocs first and then > add > them to an array? > > HD1 = < This is a heredoc. > The first of 2. > ENDHD1 > > HD2 = < This is the second heredoc. > ie the last. > ENDHD2 > > a=[HD1,HD2] Well, we are not advocating here documents in a row, we are just answering a technical question about whether is possible to have them that way.