note
salva
I faced a similar problem while writting [mod://Net::SFTP::Foreign].
<p>My solution was to create a set of functions which pop the data from the buffer, allowing me to write code as the following:
<c>
my $buffer = read ...;
my $len = get_int32($buffer);
my $cmd = get_int8($buffer);
my $txt = get_string($buffer);
</c>
This is the module implementing those functions: [https://metacpan.org/source/SALVA/Net-SFTP-Foreign-1.93/lib%2FNet%2FSFTP%2FForeign%2FBuffer.pm|Net::SFTP::Foreign::Buffer].
11127252
11127252