logger wrote: > SOrry actually my framing of the question was wrong > my actual query was > How to match this pattern > > \x00020bb8a9f3702f0000000000000000 > > I think is it > > and then break it into > > into > v6=3000 // dec of 0bb8 > v7=169.43.112.47 // (a9f3702f converted to decimal ) > > I mean to retrieve the IP from the Hex hidden inside
use Socket; $_ = "\x00\x02\x0b\xb8\xa9\xf3\x70\x2f\x00\x00\x00\x00\x00\x00\x00\x00"; printf "v6=%d\n", unpack 'n', substr $_, 2, 2; printf "v7=%s\n", inet_ntoa (substr $_, 4, 4); -- ,-/- __ _ _ $Bill Luebkert ICQ=162126130 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/ _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs