ronniec has asked for the wisdom of the Perl Monks concerning the following question:
The actual code in my script is :-Argument "SOCK_DGRAM" isn't numeric in socket at RC_Bad_wakeonlan.pl l +ine 59, <I NF> line 1. Argument "AF_INET" isn't numeric in socket at RC_Bad_wakeonlan.pl line + 59, <INF> line 1. socket : at RC_Bad_wakeonlan.pl line 59, <INF> line 1.
my $Domain = "AF_INET" ; my $Type = "SOCK_DGRAM" ; my $Level = 'SOL_SOCKET' ; my $Optname = 'SO_BROADCAST' ; # # Alocate socket and send packet $raddr = gethostbyname($ipaddr); $them = pack_sockaddr_in($port, $raddr); $proto = getprotobyname('udp'); socket(S, $Domain, $Type, $proto) or die "socket : $!"; setsockopt(S, $Level,$Optname, 1) or die "setsockopt : $!"; print "Sending magic packet to $ipaddr:$port with $hwaddr\n";
Is my understanding of this wanting? As I say I can get round it but I'm intrigued. I was also looking for the manual entry for setsockopt(2) (as alluded to on page 785 of the "Programming Perl" book but am unable to locate it on any of our servers (the powers that be probably thought these man pages took up too much room) is this documentation available on the net?socket(S, AF_INET, SOCK_DGRAM, $proto) or die "socket : $!"; setsockopt(S, SOL_SOCKET, SO_BROADCAST, 1) or die "setsockopt : $! +";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can you use setsockopt with the strict pragma?
by davorg (Chancellor) on Oct 25, 2006 at 15:40 UTC | |
by tye (Sage) on Oct 25, 2006 at 16:33 UTC | |
by Anonymous Monk on Oct 27, 2006 at 08:38 UTC | |
|
Re: Can you use setsockopt with the strict pragma?
by djp (Hermit) on Oct 26, 2006 at 04:11 UTC |