I hope Belsander doesn't mind me adding another question to his post given it's nearly the same question. Oppose to creating hex and sending it via UDP, I'm reading it out of a file. I have the same issue as Belsander in that the hex will arrive if I send it like this.
$socks->send('\xa1\xb1\xc1\xd1')
The file I'm using has the same format, each line looks like this (except it's about 50 bytes per line)
\xa1\xb1\xc1\xd1\xe1 \xa2\xb2\xc2\xd2\xe2
The actual code:
use strict; use warnings; use IO::Socket; my $socks = IO:Socket:INET->new( Proto => 'udp', PeerPort => 5010, PeerAddr => '101.101.101.101', ) or die "It didn't work. $! \n" my $file = 'values.hex'; open my $info, $file or die "It didn't open $file. $! \n"; while(my $line = <$info> { $socks->send($line) or die "Nope, can't send that. $! \n"; }
Any solutions would be gratefully received thanks.

In reply to Re: Sending raw hex in UDP packets by Browne
in thread Sending raw hex in UDP packets by belsamber

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.