Thanks, Shlomi.
On 04/04/2016 11:58 AM, Shlomi Fish wrote:
[snip]
>> Is substr() always byte-safe? (Using perl 5.20.2 for example)
>>
>
> What do you mean by something being "byte-safe" exactly? I'm not sure I
> understand.
I am looking for a way to be sure that substr always treats the data as
Hi Lars,
On Mon, 4 Apr 2016 10:54:34 +0300
Lars Noodén wrote:
> On 04/03/2016 02:42 PM, Shlomi Fish wrote:
> > Hi Lars and all,
> >
> > On Thu, 31 Mar 2016 11:38:44 +
> > Duncan Ferguson wrote:
> >
> >> Lars,
> >>
> >> I believe 'unpack' is the right way to go, you just need to get the
On 04/03/2016 02:42 PM, Shlomi Fish wrote:
> Hi Lars and all,
>
> On Thu, 31 Mar 2016 11:38:44 +
> Duncan Ferguson wrote:
>
>> Lars,
>>
>> I believe 'unpack' is the right way to go, you just need to get the template
>> right ('N' in your example)
>>
>
> in addition to unpack there are also:
Hi Lars and all,
On Thu, 31 Mar 2016 11:38:44 +
Duncan Ferguson wrote:
> Lars,
>
> I believe 'unpack' is the right way to go, you just need to get the template
> right ('N' in your example)
>
in addition to unpack there are also:
1. http://perldoc.perl.org/functions/vec.html - perldoc -f
scalar and returns a list of values."
($order_time, $monk, $itemname, $quantity, $ignore) =
unpack( "l i Z32 s2", $rec );
Duncs
-Original Message-
From: Lars Noodén [mailto:lars.noo...@gmail.com]
Sent: 31 March 2016 11:50
To: Perl Beginners
Subject: Processing bi
What are the best practices for working with binary data? If I read a
span of binary data, say, into $packet like with read() below
my ( $packet_size, $packet );
read( $client_socket, $packet_size, 4 );
$packet_size = unpack( "N", $packet_size );
read( $client_soc