in reply to What is the best way to pack an ip address?

When packing an IP, the four numbers are turned into four bytes.
You could also have written chr(10) . chr(10) . chr(10) . chr(1). The tenth ascii value (Update: Actually, linefeed's the eleventh ascii character, as \0 is the first) happens to be a linefeed (\n), which might cause problems if your $/ is a linefeed (which it is by default).

Note: In perl 5.6 and later, you can use vector notation for ip constants: v10.10.10.1 or just 10.10.10.1 (so you can actually write things like PeerAddr => 10.10.10.1,.

2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$