I have what I hope to be an easy question to answer but so far I have not found much in the way of enlightenment on the web. I'm working on code to traverse a routing table and run some checks on traffic I see. I need to do some bitwise & on IP addresses to match subnets. In C I would just run
161 & 255 and get 161 back.
In Perl when I run
161 & 255 I get back 041
This is not unexpected, but I need to know if there is a way to get the C type of functionality in perl, is there some simple option that I'm unaware of?
Thanks,
G