Hello Perl Monks,

Long time visitor of your forums, first time poster. I still consider myself semi-new to Perl, have only been at it for a few months. I am completely stumped on this error message: Can't do inplace edit: . is not a regular file at Copy (2) of Parsing.pl line 9. I know what causes the error, but for the life of me I cannot discover it in my own code. I am writing something very simple. Here is the code in question:
chdir("C:\\some_directory") or die "$!"; opendir (DIR, ".") or die "$!"; my @files = grep{"\\*?.txt"} readdir DIR; close DIR; local @ARGV = @files; while (<>) { if (/Words: /) { $somenumber = "print $_"; $substringoffset = substr($somenumber, 26); open MYFILE, ">>","C:\\some_directory\\Results.csv"; print MYFILE $substringoffset; } }
Essentially I am looking at multiple text files, looking for one spot where the text file has "Words" and then taking an offset of 26 and saving what comes after the 26th position. The error I get does not affect the overall functionally of my script. It does however generate annoying and unprofessional errors that unfortunately take up my cmd screen. Any ideas?

In reply to Strange Error by JimboMcDeans

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.