I realize that I will be long dead before I understand all there is to know about perl and unix. But I figure I might as well do my best, and maybe help some people out along the way. Lots of guru's have lent me a hand, and I would like to do my part. So here is a bit of information that maybe a beginner / intermediate perl programmer could use.
I've generally found that my understanding happens in sudden leaps, i.e. those 'Eureka!' moments, with long plateaus in between, where I would spend time applying my new understanding and getting into all sorts of trouble.
About a year ago, I found myself approaching the end of a plateau. I was becoming interested in how unix processes actually worked, because at the time I was working on version 2 of a homegrown spam filtering system. I wanted to implement it as a daemon, so I could eliminate the overhead of firing up a perl process for each mail I had to scan. Long story short
It didn't help that the Camel book says things like the following, in the description for the 'socket' function:
"This function opens a socket of the specified kind and attches it to a filehandle SOCKET. DOMAIN, TYPE, and PROTOCOL are specified the same as for socket(2)."
Granted that explanations of Unix syscalls are far beyond the scope of the camel book - but I needed some answers. I knew nothing of the details of DOMAIN, TYPE, and PROTOCOL, and the socket(2) manpage isn't exactly forthcoming either. It became clear that I needed to understand what was going on behind the scenes before I could continue with my project. I needed to understand, to some degree, the Unix that was happening, which would involve understanding a bit of C as well.
SHORT ANSWER TO MY PROBLEMS: "Advanced Programming in the UNIX Environment" [APUE], by W. Richard Stevens. This book not only goes through unix from a C programmer's perspective, it explains the system calls in clear english. And hooray for Perl, because the Unix system calls that perl makes available to the user look pretty much like the C library calls. Which means that a Perl programmer should be able to grok the examples without too much of a stretch. Anything that Perl's standard function library lacks (e.g. fully unbuffered pipes) can be found in the POSIX module.
APUE talks about how Unix really works. It goes into unbuffered and buffered I/O, proccess accounting, interprocess communication, signals
If your C is rusty or nonexistant, pick up K&R C, and the Harbison and Steele C book first. You may also like the O'rielly Practical C Programming book as well, though I found that it wasn't all that practical. C is worth the journey, and I'm only a few steps down the road - learning C has made me a better Perl programmer, and has given me a more solid understanding of computers in general.
Even a small understanding of C will help you get through some of the Stevens book, though in general, APUE is extraordinarily good at explaining itself, with copious examples and crystal clear writing style.
I hope all this info helps. Happy hacking.
Just for fun, here are the currently invaluable tools on my desk, in no particular order:
Advanced Programming in The Unix Environment