my $S16bits = substr($new, 0, 4, "" ); ## 4 bytes printable hex or my $S16bits = substr($ndata, 0, 2, "" ); ## 2 bytes hex data