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
do { ... }->method while... #2396
Comments
From @pjscottThis I expect (do blocks are always executed once): $ perl -le 'do {$x=42} while 0; print $x' This I don't expect: $ perl -le 'do {$x=42}->foo while 0; print $x' $ Either it's a bug that it doesn't execute the block or it's a bug that it This is more understandable: $ perl -le 'do {$x=42}->foo while 1; print $x' But I don't see why it should make a difference whether the while condition Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Characteristics of this binary (from libperl): |
From [Unknown Contact. See original ticket]On Thu, Aug 17, 2000 at 06:02:09PM -0700, "Peter Scott" wrote:
I don't consider this a bug. From perlsyn: . . . The do { In the case of:
In this case, the clause is most definately a "do-BLOCK."
In this case, the clause is a complex expression, which may as well $ perl -le 'while (0) { do {$x=42}->foo }; print $x' See the difference? The do-BLOCK used with the while/until suffix is a very special case mark -- One ring to rule them all, one ring to find them, one ring to bring them all http://mark.mielke.cc/ |
Migrated from rt.perl.org#3743 (status was 'resolved')
Searchable as RT3743$
The text was updated successfully, but these errors were encountered: