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

Re: [perl #114102] unterminateable heredocs caused by newline in delimiter

Thread Previous | Thread Next
From:
Kent Fredric
Date:
August 2, 2012 01:16
Subject:
Re: [perl #114102] unterminateable heredocs caused by newline in delimiter
Message ID:
CAATnKFC62rfDAHX+zH4toDkXjz5oH_Hdb+W+hDjfVch=p4p05A@mail.gmail.com
On 2 August 2012 19:20, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> It works in string eval.  See also #78348 and #114040.

Side note: I saw this and decided to goof around a bit with different
values of X in

$foo = <<"X";

Seems a literal \r also triggers this.

Sample script base64 encoded to preserve \r

IyEvdXNyL2Jpbi9wZXJsIAoKdXNlIDUuMTYuMDsKdXNlIHN0cmljdDsKdXNlIHdhcm5pbmdzOwoK
bXkgJGNvbnRlbnQ7CiRjb250ZW50ID08PCINIjsKQmFkIApOZXdzCmZvciB5b3UKDQoKc2F5ICRj
b250ZW50OwoK

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.

-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About