Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!harless From: harless@sdd.hp.com (Mike Harless) Newsgroups: comp.lang.perl Subject: Differences between 3.0 @41 and 44??? Message-ID: <1991Jan31.001253.7441@sdd.hp.com> Date: 31 Jan 91 00:12:53 GMT Sender: news@sdd.hp.com (Usenet News) Distribution: na Organization: Hewlett-Packard, San Diego Division Lines: 49 Nntp-Posting-Host: hpsdly.sdd.hp.com Was there some change with perl and passing file descriptors in and out of subroutines? I've applied the 42-44 patches and now one of my backup scripts is failing with 'memory fault, core dump'. In it, I'm creating a socket, and then passing it by reference to various subroutines. If I make the socket descriptor global or go back to 3.0@41 the problem goes away. I'm on an HP 9000/370 with hp-ux 7.0. Here's an example of what I'm doing: ... make_socket(S) ; ... where subroutine make_socket() looks like: sub make_socket() { local(*S) = shift(@_) ; # what socket to connect with local($them) ; local($this, $that) ; local($sockaddr) = 'S n a4 x8' ; local($name,$aliases,$proto) ; local($type,$len,$thataddr) ; ($name,$aliases,$proto) = getprotobyname('tcp') ; ($name,$aliases,$port) = getservbyname($port,'tcp') unless $port =~ /^\d+$/ ; ($name,$aliases,$type,$len,$thisaddr) = gethostbyname($host) ; ($name,$aliases,$type,$len,$thataddr) = gethostbyname($server) ; $this = pack($sockaddr, &AF_INET, 0, $thisaddr) ; $that = pack($sockaddr, &AF_INET, $port, $thataddr) ; socket(S, &PF_INET, &SOCK_STREAM, $proto) || die "socket failed, $!" ; ... Running things under 'perl -d', I get the core dump with the socket() call. Getting rid of the 'local(*S) = shift(@_)', gets around the problem and life goes on. Any ideas of what the problem can be? ...Mike