in reply to Re: Printing an array in a Here Doc
in thread Printing an array in a Here Doc

I do need newlines. But, I couldn't figure out the exact place to put the loop. Could I put it inside of the here doc?

Replies are listed 'Best First'.
Re^3: Printing an array in a Here Doc
by shmem (Chancellor) on Jun 27, 2006 at 22:31 UTC
    No. Whatsoever control statements are not evaluated in a here-doc. The here-doc is essentially a string, and if you place an array inside it, it is interpolated into the string. Yes, there is looping over the array elements going on behind the scenes, and in this loop the array elements are joined with the contents of the variable $" as glue.

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}