On Jan 31, 2012, at 1:00 PM, Lucky Nl wrote:

> In ruby we have the concpet "heredoc" to handle multiple line strings
>=20
>=20
> We can handle that with doublequotes
> for example
> x =3D "Grocery list
> ------------
>    1. Salad mix.
>    2. Strawberries.
>    3. Cereal.
>    4. Milk.
>       "
>=20
> puts x
>=20
> OUTPUT:
> Grocery list
> ------------
>    1. Salad mix.
>    2. Strawberries.
>    3. Cereal.
>    4. Milk.
>=20
> Anyspecific reason to use heredoc concept


We don't exactly "need it", but its nice to have around.

Heredoc has some special properties that can come in handy if you are =
using long literal strings in argument lists. For example, you can begin =
a Heredoc in an argument list and continue after the list is closed:

foo('test', <<-HERE, 'test')
THIS IS A LINE
AND A SECOND
HERE

Taken to the extreme, you can use 3 Heredocs:

foo(<<-FIRST, <<-SECOND, <<-THIRD)
my first text
FIRST
my second text
SECOND
my third text
THIRD

Regards,
Florian