note about undocumented caller() return value (from M.J.T. Guy);
authorGurusamy Sarathy <gsar@cpan.org>
Sun, 7 May 2000 05:24:46 +0000 (05:24 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Sun, 7 May 2000 05:24:46 +0000 (05:24 +0000)
yet another peek.t tweak

p4raw-id: //depot/perl@6083

pod/perlfunc.pod
t/lib/peek.t

index 8e66e1b..4e67506 100644 (file)
@@ -539,9 +539,10 @@ Here $subroutine may be C<(eval)> if the frame is not a subroutine
 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.
index 0b62802..255512f 100644 (file)
@@ -15,12 +15,15 @@ use Devel::Peek;
 print "1..17\n";
 
 our $DEBUG = 0;
+open(SAVERR, ">&STDERR") or die "Can't dup STDERR: $!";
 
 sub do_test {
     my $pattern = pop;
-    if (open(STDERR,">peek$$")) {
+    if (open(OUT,">peek$$")) {
+       open(STDERR, ">&OUT") or die "Can't dup OUT: $!";
        Dump($_[1]);
-       close(STDERR);
+       open(STDERR, ">&SAVERR") or die "Can't restore STDERR: $!";
+       close(OUT);
        if (open(IN, "peek$$")) {
            local $/;
            $pattern =~ s/\$ADDR/0x[[:xdigit:]]+/g;