|
Posted by Ben Morrow on March 9, 2008, 7:41 pm
Please log in for more thread options
>
> > Why is the test.txt not chmodded to 0600 but to 0755
>
> Because $sec is not a file name or a file handle. It's a good idea to
> check if any file operation succeeded:
>
> open(TEKST,">test.txt") or die $!;
> chmod 0600,*TEKST or die $!;
Don't use bare globs unless you really have to. They're very magic, and
it's always safer to use a globref when you can:
chmod 0600, \*TEKST or die $!;
Of course, a lexical filehandle would be better again.
Ben
|