Code: Alles auswählen
# ----------------------------------------------------------------------------
sub handlePowerOn {
    use IO::Socket;
	my $sock = new IO::Socket::INET (
           PeerAddr => 'net-control',
           PeerPort => '75',
           Proto => 'udp',
        );
    die "Could not create socket: $!\n" unless $sock;
        print $sock "Sw_on1user\x00\n";
        close($sock);
}
# ----------------------------------------------------------------------------
sub handlePowerOff {
    use IO::Socket;
	my $sock = new IO::Socket::INET (
           PeerAddr => 'net-control',
           PeerPort => '75',
           Proto => 'udp',
        );
    die "Could not create socket: $!\n" unless $sock;
        print $sock "Sw_off1user\x00\n";
        close($sock);
}