New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unterminateable heredocs caused by newline in delimiter #12267
Comments
From @maukeCreated by @mauke#!perl __END__ Can't find string terminator "X The error message is bogus because there is in fact a "X\n" in the code. The Either the heredoc parser needs to be fixed or this case should be diagnosed as Perl Info
|
From @jkeenanOn Thu Jul 12 03:06:39 2012, l.mai@web.de wrote:
Which we have already documented. At the end of the section on ##### Moreover, with respect to this particular error message, 'perldiag' says: ##### Why does that not suffice? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @doyOn Fri, Jul 13, 2012 at 03:18:52PM -0700, James E Keenan via RT wrote:
If this is the case, then trying to use such a string should be a -doy |
From @maukeOn 2012-07-13 James E Keenan via RT wrote:
That description ("... must be a string literal") is nonsensical. "X
Because that has nothing to do with the problem. There is a closing tag Lukas |
From @nwc10On Sat, Jul 14, 2012 at 12:50:38PM +0200, Lukas Mai wrote:
Yes, if it can't ever work, why is it even accepted? Strikes me that it's buggy to accept a terminator which contains a newline I also *think* that changing this can't actually change the behaviour of All it does is change the error reported, to one that is meaningful. Nicholas Clark |
From @cpansproutOn Mon Jul 16 03:04:46 2012, nicholas wrote:
It works in string eval. See also #78348 and #114040. -- Father Chrysostomos |
From @kentfredricOn 2 August 2012 19:20, Father Chrysostomos via RT
Side note: I saw this and decided to goof around a bit with different $foo = <<"X"; Seems a literal \r also triggers this. Sample script base64 encoded to preserve \r IyEvdXNyL2Jpbi9wZXJsIAoKdXNlIDUuMTYuMDsKdXNlIHN0cmljdDsKdXNlIHdhcm5pbmdzOwoK This also has the amusing side effect of displaying only " anywhere before EOF at /tmp/test.pl line 8 On the terminal due to the \r being output unescaped. -- perl -e "print substr( \"edrgmaM SPA NOcomil.ic\\@tfrken\", \$_ * 3, http://kent-fredric.fox.geek.nz |
From @nwc10On Thu, Aug 02, 2012 at 12:20:19AM -0700, Father Chrysostomos via RT wrote:
OK, so *right now* if we change the code to reject a terminator containing And your comment in #114040 It seems to me that toke.c was written under the assumption that the eval was added later: commit a559c25 perl 1.0 patch 8: perl needed an eval operator and a symbolic debugger I didn't add an eval operator to the original perl because Do we have a meta ticket for discrepancies due to eval being parsed with Also, I'm not sure if we can fix all of them safely. By definition, we haven't Whereas parsing a large file is potentially unbounded - when do we stop To be fair, this case, a heredoc terminator, the problem is bounded. Nicholas Clark |
From @cpansproutOn Thu Aug 02 02:19:38 2012, nicholas wrote:
We could. I’m not volunteering. :-) But I’ll consider any patch that
When we run out of memory. Yes, that does mean a missing " can cause $ perl -e 'print q|"|; print " "x70, "\n" for 1..100000000' |perl but the (worse) alternative is to impose arbitrary restrictions in a
Indeed. $ perl -le 'print "<<", f x 254' | perl -- Father Chrysostomos |
Migrated from rt.perl.org#114102 (status was 'open')
Searchable as RT114102$
The text was updated successfully, but these errors were encountered: