JimboMcDeans has asked for the wisdom of the Perl Monks concerning the following question:
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: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?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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Strange Error
by kennethk (Abbot) on Jun 07, 2011 at 22:33 UTC | |
by AnomalousMonk (Archbishop) on Jun 07, 2011 at 23:04 UTC | |
by JimboMcDeans (Initiate) on Jun 07, 2011 at 22:51 UTC | |
by kennethk (Abbot) on Jun 07, 2011 at 23:25 UTC | |
|
Re: Strange Error
by kejohm (Hermit) on Jun 07, 2011 at 22:48 UTC |