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
local $/ = <STDIN> broken #13205
Comments
From @maukeCreated by @maukeThe following programs should all produce the same output: % perl -e 'print "a\nb\nc\n"' | perl -we 'print "[$_]\n" for do { local $/ = <STDIN> }' % perl -e 'print "a\nb\nc\n"' | perl -we 'print "[$_]\n" for do { local $/ = do { <STDIN> } }' % perl -e 'print "a\nb\nc\n"' | perl -we 'print "[$_]\n" for do { local $/ = (0, <STDIN>) }' I think the first one is broken. Perl Info
|
From @cpansproutOn Tue Aug 27 13:12:01 2013, mauke- wrote:
A readline optimisation is causing the order of evaluation to change, Notice how the LVINTRO line is number 3 while readline is number 5: $ ./perl -Ilib -MO=Concise -e ' local $/ = <foo> ' Here the numbers are 5 and 4, so the execution order is different: $ ./perl -Ilib -MO=Concise -e ' local $/ = do { <foo> } ' -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @maukeOn Di. 27. Aug. 2013, 14:39:39, sprout wrote:
That optimization seems to be blatantly invalid. :-) % cat try.pl { sub TIEHANDLE { sub READLINE { our $xy = 42; tie *HDL, 'Ohai', ( { local $xy = do { <HDL> }; } % perl try.pl |
Migrated from rt.perl.org#119487 (status was 'open')
Searchable as RT119487$
The text was updated successfully, but these errors were encountered: