I'm getting a troubling (but non-fatal) warning when trying to use the File::Copy module to copy files. I asked about this earlier in the chatterbox and tried advice I got there, but to no avail...

I've tested this first on my own desktop under Windows 2000 Professional, running ActivePerl v5.8.7 (ActiveState build 813), and as well on our win32 server under Windows 2003 Server, running ActivePerl v5.8.8 (ActiveState build 817).

The problem occurs within the following code:

print "Copying $src_path\\$upc\\$tracknum.mp3 to $dst_path\\$upc\\$tra +cknum.mp3\n"; copy("$src_path\\$upc\\$tracknum.mp3","$dst_path\\$upc\\$tracknum.mp3" +) or warn "Couldn't copy $src_path\\$upc\\$realtracknum.mp3: $!";
I get the following output (this occurs in a loop, so the same output w/ warning repeats with 02.mp3, 03.mp3, etc):
Copying m:\music\tracks\685506213212\01.mp3 to m:\music\tagged\6855062 +13212\01.mp3 Attempt to free unreferenced scalar: SV 0x1e77330, Perl interpreter: 0 +x15d45fc at C:/Perl/lib/File/Copy.pm line 91.
The copy actually succeeds, so my warn() is never called. But a different warning seems to be generated by the File::Copy module itself. I've even tried using forward-slashes in the paths instead of backslashes, with the same result. I could just use a backticked system command, but I'd like to keep it portable in case we move this to one of our linux servers later on.

I've found messages from assorted mailing lists and forums that leads me to believe this is an error internal to the perl interpreter and is rather rare, could this be the case?



UPDATE: thanks to imp, it seems to be some kind of conflict between DBI and File::Copy, when running on ActiveState's build of perl. I'm going to report this to ActiveState as a bug, and use Win32::CopyFile() directly in the meantime. Thanks for the help, everyone!

__________
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
- Terry Pratchett


In reply to Attempt to free unreferenced scalar in File::Copy (ActivePerl) by EvanK

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.