in reply to Binary buffer - substr
use strict; use warnings; use 5.012; my $str = "\x16-\x03\x01\x01-\x16\x03\x01\x01PAY\nLOAD"; if ($str =~ /(\x16\x03\x01\x01 .*)/xms) { say $1; printf "%vd \n", $1; say length($str) - length($1); } --output:-- PAY LOAD 22.3.1.1.80.65.89.10.76.79.65.68 6
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Binary buffer - substr
by dave_the_m (Monsignor) on Jan 14, 2013 at 08:26 UTC |