2011/5/4 loudking <loudk...@gmail.com>:
> Hi there,
>
> Hereby I have a string parsing problem to ask. The sample strings look
> like this:
>
> 00000000: CC02 0000 0565 0000 8E93 D501 0100 6273 .....e........b
> 00000000: 6800 0000 0500 0000 9093 D501 0100 1400 h...............
>
> What I am interested is the the 21st and 22nd byte value. In the above
> examples, they are both 05.
>


This could work:

while(<DATA>) {
    my ($mat) = /^.{20}(.{2})/;
    print $mat,"\n";
}


-- 
Jeff Pang
www.DNSbed.com

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to