Firstly, yes it is possible to write to a local file. I tried your program and it worked creating menu.txt.

If the file didn't get created then it is probably being created somewhere else. Put a

use Cwd; print cwd();
Into your program to see where it thinks the current directory is, then look there for menu.txt

Secondly - check the version of perl between your local machine and the remote machine.

perl -V
Will tell you, or if you don't have shell access just run that from a system command.

If it is < perl 5.6 then use diagnostics won't work which is a possibly explanation.


In reply to Re: write to local files? and why does strict bugger this online but not locally? by ncw
in thread write to local files? and why does strict bugger this online but not locally? by jerrygarciuh

Title:
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, details, 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, summary, 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.