Basically, use 0666 for regular files and 0777 for directories. This because the user can always remove permissions they don't want by setting their umask, but there's no way to be more permissive than the program's hard-coded value. So give the user choice, but don't take it away.
This was Tom's advice--I wasn't particularly umask-clueful when we were writing the book. He really pushed me to learn exactly what it was and how it worked. Ah, good days.
This, thankfully, is one thing that won't have to be updated for these heady 5.6 and 5.8 days!
We've had a long to-and-fro about the virtues of retaining bareword FILEHANDLE syntax versus going with the new $fh filehandle-as-variable syntax made possible by:
I'm the progressive force, as I was on the old Cookbook, always arguing for the new stuff. He's the traditionalist, able to muster a million arguments why the new stuff is crap
I have to say, though, that I'm in love with
I love being able to lexically scope my filehandles. (ha, get it? "my" filehandles? Oh I kill me). And the new three-argument form of open kicks ass. You can read/write to strings with the builtin open now, for pete's sake!
open $fh, "<", \$string
Now that's making easy things easy.