Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by williff (Initiate)
on Feb 14, 2011 at 21:56 UTC ( [id://888076]=note: print w/replies, xml ) Need Help??


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

Thanks for great suggestions. Moved close after chmod but it did not help.

Working on Linux box, uname -a says: Linux ... 2.6.9-89.0.16.ELxenU #1 SMP Tue Oct 27 04:12:25 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

chmod returns 0 and $! returns "No such file or directory" even after moving close after chmod.

will investigate globs, glob refs. I think those are used in main, but a scalar ref was used with this sub.

  • Comment on Re^2: Why doesn't chmod work on this lexical filehandle?

Replies are listed 'Best First'.
Re^3: Why doesn't chmod work on this lexical filehandle? (error)
by tye (Sage) on Feb 15, 2011 at 06:24 UTC

    Then it sounds like $OUT is being interpreted as a string and that that string is being interpreted as a file name: If chmod had thought that you had passed a file handle to it on a system where Perl doesn't think fchmod() is supported, then it would have died rather than returning 0. If you passed a file handle to chmod() on a system with fchmod, "No such file or directory" could not have been the failure reason.

    - tye        

Re^3: Why doesn't chmod work on this lexical filehandle?
by Anonyrnous Monk (Hermit) on Feb 15, 2011 at 07:49 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://888076]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found