Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Greetings o wise ones,

I have script that uses the File::Inplace and WWW::Mechanize modules. opens and edits an html file and saves it as /var/www/mypage.html (i.e. Apache's server root), whereupon Mechanize browses to it and attempts to interact with it. Instead, it gets a 403 Forbidden error.

Upon investigating I find that the file permissions on mypage.html are set to 600. If I chmod it to 777 and then just have Mechanize browse to it (without editing it first) it loads fine. But after Inplace is finished with it, the permissions are back to 600 again and Mechanize gets the 403 error. So, what is Inplace doing and how and why is it changing permissions? And how can I stop it?

(By the way, if I chown the file to any UID I want, even root, the file still comes back chmoded to 600 and owned by mojodaddy.)

Hey -- just thought of this: maybe I could somehow have the script change the permissions on the file before Mechanize browses to it... (but this seems kind of like putting "use warnings" in your script but then commenting it out when you get warnings...), and I'm sure I could do this without, but I'd really rather understand what's going on and see if there's an easier fix before rewriting the whole script.

My thanks, wise ones, for any assistance you may be willing to bestow.

In reply to File::Inplace module is altering file permissions/ownership by mojodaddy

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (6)
    As of 2017-10-22 02:56 GMT
    Find Nodes?
      Voting Booth?
      My fridge is mostly full of:

      Results (272 votes). Check out past polls.