[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] '' vs q()



At 16:43 -0400 19.05.98, Chaim Frenkel wrote:

I did say "my opinion" didn't I?

>print <<TIMTOWTDI;
>No, way.
>
>Here docs are just too useful. Especially for _very_ long textual
>areas. I'm especially fond of them when working with Sql when I don't
>want to bother with a stored procedure.
>
>Think of it as another quoting mechanism.
>
>As the saying goes:
>TIMTOWTDI

Sure, there's more than one way to do it. So I tell people in my courses to
put their _very_ long quoted texts after __END__ and read it via DATA. And
yes, you can put more than one chunk of text after it without obfuscating
your code.

And given what I see when beginners learn about here documents, I stand by
my opinion that more often than not they are one of the more troublesome
ways to do it: there's the semicolon/no semicolon issue, the accidental
space before the identifier/string, the question whether 'no quotes' is
equivalent to single or double quotes and last but not least there's Chris'
excellent example of easy obfuscation (light) with here documents.

Yes, Tom, I knew that thousands of dead perl programmers would cry out loud ;-)

	--jc

--
JŸrgen Christoffel, GMD - Forschungszentrum Informationstechnik GmbH
E-Mail: christoffel@gmd.de or one of {ftp,news,web}master@gmd.de



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch