in reply to RegEx Confusion!
HTHmy $bit_string = "01111110000000000000010001011100100101111110"; # starting at the front, take 8 characters my $flag = substr($bit_string,0,8); # start 8 chars in, get 16 out. my $byte_count = substr($bit_string,8,16); # start at the END and get 8 characters; my $flag2 = substr($bit_string,-8,8); # the mystery part. 24 chars in, length of parts we haven't taken out +yet. my $the_rest = substr($bit_string,24,(length($bit_string) - 24 - 8));
Update The things you find on CPAN. NetPacket may do exactly what you need
/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"
|
|---|