develooper Front page | perl.perl5.porters | Postings from August 2000

Re: [ID 20000804.003] heredoc in s///e replacement

Thread Previous | Thread Next
August 4, 2000 11:15
Re: [ID 20000804.003] heredoc in s///e replacement
Message ID:
In <>, Ronald J Kimball writes:
:On Fri, Aug 04, 2000 at 01:37:12PM +0100, Hugo wrote:
:> Trawling through old messages, I found this aside in
:> The following code gives the same results with all perls I've checked
:> after 5.004 up to and including bleadperl (it fails to find the end of
:> the heredoc in 5.004 and earlier):
:> crypt% ./perl -wl
:> $_ = "test";
:> s/t/<<E/eg;
:>   "new"
:> E
:> print
:> __END__
:>   "new"
:> es  "new"
:> crypt% 
:What is the bug?

Gak, it's my head. I'm expecting the string to eval-and-replace to
be qq{  "new"\n}, to become qq{new} after eval: it seems wrong that
the string should be qq{<<E}, since in that case it seems like the
compiler should not know to attribute the heredoc to it. But I have
a nasty suspicion that the compiler not knowing that was a bug I
fixed myself a mere sprinkling of eons ago.

I've probably been getting too much sleep, or something.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About