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

Re: [MacPerl] '' vs q()



At 15.07 -0500 1998.05.19, Juergen Christoffel wrote:
>"There must be no space between the << and the identifier. (If you insert a
>space, it will be treated as a null identifier, which is valid but
>deprecated, and matches the first blank line [...]"
>
>So what can we learn from that? First of all, your example doesn't have a
>blank line to end the here document, so perl gives a valid error message.

You missed the point.  We know why it does not work.  Someone was just
hoping to find a way to use q// and qq// with it.


>Finally, it is my opinion that here documents should be deprecated in the
>next version, because one can easily accomplish the same with generalized
>quoting which is less troublesome syntactically.

No way.  Here docs rule, and are much easier to use with printf() and other
functions/operators.

printf(<<EOT, $_, $tracka, $artist, $track, $note, $album, $year);
Track %2s:%.26s:0:%.30s:%.30s:%.30s:%.30s:%.4s:
EOT

print $x == 1 ? <<EOT1 : <<EOT2;
This is cool.
EOT1
This is dumb.
EOT2

Here docs rule.  That simple.  Sure, the simple "$x = <<EOT" can be done
simply with regular quoting.  But to deprecate something this cool and
relatively harmless is Bad.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
MacPerl: Power and Ease (ISBN 1881957322), http://www.ptf.com/macperl/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])



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