http://www.perlmonks.org?node_id=888148


in reply to Re^2: Why doesn't chmod work on this lexical filehandle?
in thread Why doesn't chmod work on this lexical filehandle?

Most likely, your Perl is too old.

From perldelta of 5.8.8:

  • chdir, chmod and chown can now work on filehandles as well as filenames, if the system supports respectively fchdir , fchmod and fchown , thanks to a patch provided by Gisle Aas.

See also Re^2: Why doesn't chmod work on this lexical filehandle?

Replies are listed 'Best First'.
Re^4: Why doesn't chmod work on this lexical filehandle?
by williff (Initiate) on Feb 15, 2011 at 15:23 UTC

    Yes! This is the problem. Our default perl at /usr/local/bin/perl is a symlink to 5.8. When i pointed to the latest version installed, which was 5.10.1, then the code works great. Thank you. And thanks to all Perl Monks sharing their wisdom and debug tips.