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
Silly function syndrome #7109
Comments
From dom@idealx.comCreated by dom@idealx.comThe empty sub (just "sub {}") behaves funny: perl -we 'sub zoo { wantarray ? @_ : undef } print scalar zoo(1,2); print zoo(1,2);' In other words, it returns undef in scalar context, but @_ in list Perl Info
|
From kstar@cpan.orgOn Feb 18, Dominique Quatravaux wrote:
What exactly would you want or expect? This is appropriate - Kurt |
The RT System itself - Status changed from 'new' to 'open' |
From @pjcjOn Wed, Feb 18, 2004 at 06:52:00PM -0500, Kurt Starsinic wrote:
I suspect that the test case should have been: perl -we 'sub zoo {} print scalar zoo(1,2); print zoo(1,2);' This has been fixed in 5.8.0, broken again in 5.8.1, and fixed again in -- |
From @mjdominusCreated by @mjdominusWhat does this print? sub foo { sub bar { } print foo(); Says "perlsub": "The return value of a subroutine is the value of the Now consider this: sub foo { sub bar { } print foo(); The last expression evaluated is still $x. But bar() no longer Perl Info
|
From @iabynOn Wed, Feb 18, 2004 at 08:56:38PM -0500, Mark Jason Dominus wrote:
It does now... -- Change 22595 by davem@davem-percy on 2004/03/26 17:28:48 [perl #26839] document the return value of an empty sub Affected files ... ... //depot/perl/pod/perlsub.pod#57 edit Differences ... ==== //depot/perl/pod/perlsub.pod#57 (text) ==== @@ -67,7 +67,8 @@ The return value of a subroutine is the value of the last expression |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#26839 (status was 'resolved')
Searchable as RT26839$
The text was updated successfully, but these errors were encountered: