Heredoc issue in pugs.
#!/usr/bin/env pugs my $a = q:t /END/ test END; $a.perl.say; Above example works ok in pugs, But the problem is. From S02 Heredocs are no longer written with , but with an adverb on any other quote construct: print qq:to/END/; Give $amount to the man behind curtain number $curtain. END Which is correct?
Re: Heredoc issue in pugs.
On Wed, Aug 23, 2006 at 02:16:11AM +0800, Yiyi Hu wrote: : #!/usr/bin/env pugs : : my $a = q:t /END/ : test : END; : : $a.perl.say; : : Above example works ok in pugs, But the problem is. : From S02 : : Heredocs are no longer written with , but with an adverb on any : other quote construct: : :print qq:to/END/; :Give $amount to the man behind curtain number $curtain. :END : : Which is correct? Both of them are. See the table further down that says: Short LongMeaning = === ... :t :to Interpret result as heredoc terminator ... Larry
Re: Heredoc issue in pugs.
: my $a = q:t /END/ : test : END; :print qq:to/END/; :Give $amount to the man behind curtain number $curtain. :END : Which is correct? Both of them are. See the table further down that says: What about the semicolon? After the terminator, or after the opening line? -- Your inertially corrupt space-time disagrees with me. -- Will McCarthy http://surreal.istic.org/ It sounded right in my head. pgpT6nAXOuFGs.pgp Description: PGP signature
Re: Heredoc issue in pugs.
On Tue, Aug 22, 2006 at 08:12:09PM +0100, Daniel Hulme wrote: : : my $a = q:t /END/ : : test : : END; : : :print qq:to/END/; : :Give $amount to the man behind curtain number $curtain. : :END : : : Which is correct? : : Both of them are. See the table further down that says: : : What about the semicolon? After the terminator, or after the opening : line? Ah, missed that, thanks. On the opening line is correct, just as in Perl 5. The heredoc is just a term with some indirection, and the indirection is completely line oriented. The terminator must still be on a line by itself, with nothing but whitespace. We could just as easily have a POD indirection that said print qq:from/FOO/; and it would go looking for the nearest =begin FOO block to insert. So syntactically, it's only sort of happenstance that with heredocs the document happens to be here. The inline-ness of it is secondary to the line-orientedness of it, in my mind. And it is often not, in fact, truly inline, as demonstrated by print qq:to/FOO/, qq:to/BAR/; ... FOO ... BAR It's really just a way to abstract a large string containing newlines into a single token that doesn't. Larry
Re: Heredoc issue in pugs.
On 8/22/06, Larry Wall [EMAIL PROTECTED] wrote: print qq:from/FOO/; On a somewhat related, somewhat unrelated note, I am a little bit worried about the false duality of :to and :from. Luke
Re: Heredoc issue in pugs.
On Tue, Aug 22, 2006 at 08:32:52PM +, Luke Palmer wrote: : On 8/22/06, Larry Wall [EMAIL PROTECTED] wrote: : print qq:from/FOO/; : : On a somewhat related, somewhat unrelated note, I am a little bit : worried about the false duality of :to and :from. Well, that's kinda why theres's no :from actually. It was probably not beneficial to bring in a counterfactual example. Pod docs would actually come in through %=PODFOO or some such. Heredocs are a little more special because they have to interpolate from the local lexical pad, so in that sense they really are a bit more in-line-ish. Larry
Re: Heredoc issue in pugs.
On Wed, Aug 23, 2006 at 02:16:11AM +0800, Yiyi Hu wrote: #!/usr/bin/env pugs my $a = q:t /END/ test END; $a.perl.say; Above example works ok in pugs, But the problem is. From S02 Heredocs are no longer written with , but with an adverb on any other quote construct: print qq:to/END/; Give $amount to the man behind curtain number $curtain. END Which is correct? If I remember correctly, Larry and Audrey discussed this at the Chicago hackathon and updated the Synopsis at that time. So my guess is that the Synopsis is correct. -kolibrie