Hi all, I'm writing a script to copy files from a temporary holding directory to a permanent directory. These files have a particular name format: m0120719.gz would be the file created at 3 P.M. The file names will be different for every hour and day (m is an identifying character, 0 is the last digit of the current year, 12 is the month, 07 is the day of the month, 19 is the hour in GMT the file was created). Using scalar variables and printf I can get Perl to output the correct filename and potential destination directory (the files will ultimately be copied to a directory with the name syntax of YYYYMM, e.g. 200012). Here is the code I have cobbled together so far: #print out filename to copy on screen use Time::gmtime; $tm = gmtime; printf("The current file to copy is m%03d%02d%02d.gz\n", ($tm->year+1900, $tm->mon)+1, $tm->mday, $tm->hour-1); #print out directory to copy to on screen use Time::gmtime; $tm2 = gmtime; printf("The correct directory to copy the above file to is %04d%02d\n", ($tm2->year+1900),($tm2->mon+1) ); #set array for directory to copy file to use Time::gmtime; $gm = gmtime; @dtc = ($gm->year+1900,$gm->mon+1); print @dtc; printf("\n"); #set array for file to copy use Time::gmtime; $tm3 = gmtime(); @ftc = ("m",($tm3->year+1900,$tm3->mon)+1,($tm3->mday),($tm3->hour-1),(".gz")); print @ftc; printf("\n"); The first three portions of the code work as I expected, however the value written to the last array variable does not include zeroes where I expected/hoped it would... below is the output from perl: The current file to copy is m0120719.gz The correct directory to copy the above file to is 200012 200012 m12719.gz I had hoped to use the array variables as containers for the filenames and destination directories that will change hourly and monthly respectively, and planned to use something like use File::Copy; copy(@ftc, @dtc/@ftc); or die "copy failed: $!"; to copy the files once the correct names and destinations were established. Am I totally off track in my approach here, or is there a way to format the contents of the @ftc variable to include the zeroes I need? (I also suspect if I were writing this script in January instead of December my month values would be missing the zero I need... I'll adjust my system time to check this). Any help/hints will be appreciated. Mike Hyslop # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org