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:
open $fh,
...
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
open $fh,
...
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.
--Nat
my filehandles (Score:2)
I always advise people to use lexical filehandles (Score:2)
Globals bite (in both senses ;-).
bah (Score:2)
Me too! (Score:1)
Recipe 15.17 comment (Score:1)
Doing it this way also made it unnecessary to start another process. (