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
$hasargs return from caller(0) is bogus. #1934
Comments
From lr@hpllr1.hpl.hp.comThis is a bug report for perl from lr@hpl.hp.com, [Please enter your report here] #!/usr/local/bin/perl -w sub f { print +(caller 0)[4], "\n" } f; Output: 1 The first three '1' values are incorrect, because the call has no arguments. I have confirmed the same behavior on ActivePerl 5.6.0 on Windows NT. Site configuration information for perl 5.00503: Configured by lr at Wed Jul 21 17:32:46 PDT 1999. Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: |
From [Unknown Contact. See original ticket]On Thu, 4 May 2000, Larry Rosler wrote:
From perlvar: Subroutines may be called recursively. If a subroutine is &foo(1,2,3); # pass three arguments foo(); # pass a null list &foo; # foo() get current args, like foo(@_) !! Not only does the "&" form make the argument list |
From [Unknown Contact. See original ticket]
Thanks for your prompt and, ultimately, demystifying response.
No, it is from perlsub.
The first sentence is misleadingly irrelevant to the rest of the After much re-reading, I conclude that $hasargs means that a @_ has been I suggest that as $hasargs is undocumented in perlfunc -f caller, that |
From [Unknown Contact. See original ticket]"Larry Rosler" <lr@hpl.hp.com> wrote
Like this? (patch for 5.6.0) Mike Guy Inline Patch--- ./pod/perlfunc.pod.orig Wed Apr 26 16:24:55 2000
+++ ./pod/perlfunc.pod Fri May 5 18:35:21 2000
@@ -539,9 +539,10 @@
call, but an C<eval>. In such a case additional elements $evaltext and
C<$is_require> are set: C<$is_require> is true if the frame is created by a
C<require> or C<use> statement, $evaltext contains the text of the
-C<eval EXPR> statement. In particular, for a C<eval BLOCK> statement,
+C<eval EXPR> statement. In particular, for an C<eval BLOCK> statement,
$filename is C<(eval)>, but $evaltext is undefined. (Note also that
each C<use> statement creates a C<require> frame inside an C<eval EXPR>)
+frame. C<$hasargs> is true if a new instance of C<@_> was set up for the
frame. C<$hints> and C<$bitmask> contain pragmatic hints that the caller
was compiled with. The C<$hints> and C<$bitmask> values are subject to
change between versions of Perl, and are not meant for external use.
End of patch |
From [Unknown Contact. See original ticket]
It's a lot better than what is there now (nothing). One might choose to C<$hasargs> is true if a new instance of C<@_> was set up for the frame Larry |
From @floatingatollThe documentation patches suggested in this ticket have been included into - R. |
@floatingatoll - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#3204 (status was 'resolved')
Searchable as RT3204$
The text was updated successfully, but these errors were encountered: