Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!decwrl!pa.dec.com!decuac!haven!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: caller doesn't work in signal handler Message-ID: <1991Apr10.233240.29339@uvaarpa.Virginia.EDU> Date: 10 Apr 91 23:32:40 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 52 I was hoping to use the interval timer to do some crude profiling of my Perl program, but I discovered that the call forced by a signal does not set whatever it is that 'caller' reads. Can this be fixed? More specifically, the program #! /usr/local/bin/perl &setup_profile; for (;;) { for ($i = 0; $i < 100; $i++) {} print "tick\n"; } package profile; sub main'setup_profile { $SYS_setitimer = 83; $ITIMER_PROF = 2; $interval = 1; local($value) = pack('LLLL', $interval, 0, $interval, 0); $main'SIG{'PROF'} = "profile'report"; syscall($SYS_setitimer, $ITIMER_PROF, $value, 0) && die "syscall() failed"; } sub report { print "profile ", join(' ', caller), "\n"; } gives the output (on Perl 3.44): tick tick tick tick tick tick tick tick tick There is no caller at tick line 26. Dale Dale Worley Compass, Inc. worley@compass.com -- Gag me with a BITNET!