i'll give you some non-tested code:

use File::Copy; ## set up directories my $in_dir = '/dir/main'; my @xfer_dirs = qw! /dir/dir_1 /dir/dir_2 /dir/dir_3 !; ## list of files in $in_dir my @infiles; ## pick a random dir to start ## so salesperson 1 doesn't get more mail when the job restarts my $xfer_dir_index = int rand @xfer_dirs; { ## create a directory handle local *DH; ## open the directory opendir( DH, $in_dir ) or die "ERROR: $0 - can't open dir $in_dir - +$!"; ## get a list of files @infiles = grep { /^\./ && -f "$in_dir/$_" } readdir(DIR); ## close the directory closedir DH; } for @infiles { ## move the file move( $in_dir . '/' . $_, $xfer_dirs[$xfer_dirs_index] . '/' . $_ ); ## cycle the directory index $xfer_dir_index++ $xfer_dir_index %= @xfer_dirs; } ## sleep sleep(300);

~Particle *accelerates*


In reply to Re: sequential file handling (again) by particle
in thread sequential file handling (again) by airblaine

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.