http://www.perlmonks.org?node_id=90276


in reply to Here, doccy doccy. nice doccy. heredoc, treat.

A small question, perhaps, but why would you need to use here docs with qw? The following would do what (I think) you're trying to do with your final section of code:

my @list = qw( Foo Bar Baz ); print "@list\n";

Will print out Foo Bar Baz unless you have a different list item separator...

I'm more than willing to concede that I likely am just not thinking hard enough (or I don't know enough) to envision a case where this wouldn't be optimal, but... I just don't see why here-docing things like qw would ever be necessary (or really, even desirable).

Although I can't deny it is interesting.

Update: (re: jeffa) Point taken. :)

Update #2: (re: Vynce) True, there could (should?) be some uses for this sort of thing in the future. I guess I was just thinking in "Why?" instead of "Why not?" mode.

His Royal Cheeziness