#!/usr/bin/perl -w use strict; my $pid=$ARGV[0]; my $trace_out; my $strace_pid; eval { local $SIG{ALRM} = sub { kill 2, $strace_pid || warn "couldn't kill $strace_pid: $!"; close STRACE or die "couldn't close strace"; die "exiting eval"; }; $strace_pid = open (STRACE,"strace -q -p$pid 2>&1|") or die "couldn't open strace"; alarm (1); undef $/; $trace_out= ; }; print "traceout is $trace_out";