in reply to Moving Log files remotely

That's pretty icky. You really shouldn't be doing system calls unless absolutely necessary; there are plenty of Perl modules around which perform the functionality you're looking for, such as the File modules. You should check out perldoc.com, as well as the O'Reilly Learning Perl on Win32 book to learn more about Perl. There are also a lot of Win32 modules around that you might find interesting.

You might want to try this out:

use File::Spec; use File::Copy; # Here's where some of your code is that sets some variables, gets the + timestamp in array context... $year += 1900; # Y2K-compliant my $dir_prefix = sprintf("%04d%02d%02d%02d%02d%02d", $year, $mon, $mda +y, $hour, $min, $sec); my $create_dir = File::Spec->catfile($filedir, $dir_prefix); if (!-e $create_dir) { if (!mkdir($create_dir)) { # Do something. } else { if (!move($IWlogs, $create_dir)) { # Do something. } } }

Replies are listed 'Best First'.
Re: Re: Moving Log files remotely
by Anonymous Monk on Sep 10, 2002 at 21:21 UTC
    I tried it and this is what I get. Scalar found where operator expected at testWL2.pl line 10, near "y, $hour, $min , $sec" syntax error at testWL2.pl line 10, near "$mda y, $hour, $min," Execution of testWL2.pl aborted due to compilation errors.
      Change $mda y to $mday.

      Hmmm... Maybe this will buy me some downvotes, but:

      In response to the time fellow monks spend to help you, you could at least try to understand the snipplets. This is so trivial it hurts (and it was merely a cut & paste error on your behalf). We're not here to do your work (even if we sometimes do).

      Urm.. Now I feel bad, having written this, I really don't mean to be arrogant. From your style I assume you're a beginner, but you would have found this on your own. All of us here like to help, but we also like to make people trust in their own problem solving abilities.

      So long,
      Flexx