Hi Monks,

I come seeking some guidance on the best way for me to perform multiple file copies and log the time at which the file copy was performed. I've created the following script that runs great on ActiveState perl on my Windows laptop, however when I move it over to a linux box it no workie....

Here is the script that I have written:
#!perl -w ###################################################################### +######### # File copier logger ###################################################################### +######## use strict; use Time::localtime; use File::Copy; $copyLog = "perlCopy.log"; $now = ctime(); open(COPYLOG, ">> $copyLog") or die "can't open the log file"; $count=1; while ($count < 28) { $count+=1; $fileCopy = "lab-as-h06-vm$count.dsk"; if($count < 10) { $fileCopy = "lab-as-h06-vm0$count.dsk"; } copy("lab-as-h06-vm01.dsk","$fileCopy"); print COPYLOG "$fileCopy copy started at $now \n"; }

When I run the script on my Linux box I get the following error:

Execution of fileCopy.pl aborted due to compilation errors.

I'm guessing it has to do with the File::Copy not being available. I'm not quite sure of the configuration of the Perl install on the Linux box as it is not my machine, but can anyone tell me where I should go from here. What Should I look at on the Linux box to ensure that the modules are available, Is there something my scripts should do differently on Linux?? All prayers welcome...

In reply to File Copy on Linux by Anonymous Monk

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.