use strict; use Socket; socket(my $socket, PF_INET, SOCK_STREAM, 0) or die "socket: $!"; # crashes here: close($socket);