develooper Front page | perl.perl5.porters | Postings from May 2004

[perl #29851] Problem with Carp and Safe

Thread Previous | Thread Next
From:
Lionel CONS
Date:
May 25, 2004 04:22
Subject:
[perl #29851] Problem with Carp and Safe
Message ID:
rt-3.0.9-29851-88115.18.1319861269982@perl.org
# New Ticket Created by  Lionel CONS 
# Please include the string:  [perl #29851]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=29851 >


Some old code of mine stopped working on recent versions of Perl.
After debugging, the problem seems to be in some incompatibility
between Carp and Safe.

Here is some test code:

  use Safe;
  use Carp;
  sub foo {
      print("begin\n");
      carp("carp");
      print("end\n");
  }
  $| = 1;
  print("this is Perl $]\n");
  $cpt = new Safe;
  $cpt->share("foo");
  $cpt->reval("foo()");
  die($@) if $@;

And here are the results on some machines:

Ancient Red Hat 6.x (this one seems correct to me):
 this is Perl 5.00503
 begin
 carp at (eval 2) line 1
 end

Red Hat 7.x box:
 this is Perl 5.006001
 begin

Red Hat Enterprise Linux 3.x:
 this is Perl 5.008
 begin

Do you understand why the Safe/eval'ed code silently stops when
attempting to carp()?

Thanks in advance for your help,
__________________________________________________________
Lionel Cons        http://cern.ch/lionel.cons
CERN               http://www.cern.ch
 
Murphy's 5th Law:
	If anything simply cannot go wrong, it will anyway.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About