in reply to Re: Sending a packet and getting reply.
in thread Sending a packet and getting reply.

Here is a snippet of the ruby code. Im somewhat new to perl so i dont know how i would add it in.
1_string = "\x97\x00\x00\x00\xAA\x00\x00\x00" socket = UDPSocket.open socket.send(1_string, 0, target_server, target_port) if select([socket], nil, nil, TIMEOUT) response = socket.recvfrom(10)

Replies are listed 'Best First'.
Re^3: Sending a packet and getting reply.
by Corion (Patriarch) on Jan 15, 2014 at 12:22 UTC

    What parts are problematic?

    As you know Ruby, I'll give you some simple/simplicistic transaltion rules for Ruby to Perl:

    • Simple variables in Perl need to start with a letter. Also, they are usually prefixed by $.
    • For opening an UDP socket, use IO::Socket::INET. It has almost the same methods as UDPSocket.
    • nil is undef in Perl.
      Thank you for the reply, but im not looking to translate the code. i want to just get an example for this is all.