Ok, here is the updated script. I can run it with the warnings on and get every single warning, but each system call is completing properly. Each status is being returned as 0. Very strange. If anyone can thing of something else to check on the system calls, I'd appreciate it.
use strict; use warnings; use Cwd; use Getopt::Long; my ($help) = 0; my ($num) = 20; # Number of loops to run my ($testdir) = ""; my ($verbose) = 0; GetOptions('help|?' => \$help, "num=i" => \$num, "testdir=s" => \$testdir, 'verbose' => \$verbose) or &usage(); &usage() if $help; # Header print "Beginning Directory Manipulation Testing...\n" if $verbose; $| = 1; # Get the current working directory my $home_dir = getcwd; # Change to the test directory chdir($testdir) or die "Can't make $testdir: $!\n"; # Set up test dirs if they do not exist if (!-d "test") { mkdir("test") or die "Can't make $testdir\\test: $!\n"; } if (!-d "test1") { mkdir("test1") or die "Can't make $testdir\\test1: $!\n"; } # Change to the test area chdir("test") or die "Can't change to test directory: $!\n"; # Directory Manipulation for (my $dir = 0; $dir < $num; $dir++) { # Make the directory if (!-d "directory$dir" ) { mkdir("directory$dir", 0755) or die "Can't make $testdir\\test +\\directory$dir: $!\n"; } # Change permissions of the directory if ($^O =~ /Win32/) { print "\nRunning chmod from - $home_dir\\..\\..\\bin\\chmod on + $testdir\\test\\directory$dir.\n" if ($verbose); if ($verbose) { system($home_dir . "\\..\\..\\bin\\chmod -v a+rwx $testdir +\\test\\directory$dir"); } else { system($home_dir . "\\..\\..\\bin\\chmod a+rwx $testdir\\t +est\\directory$dir"); } } else { system("/bin/chmod 777 directory$dir"); or warn "Could not chmod directory$dir: $?\n"; } # Copy the directory if ($^O =~ /Win32/) { print "\nRunning $home_dir\\..\\..\\bin\\cp on $testdir\\test\\directory$dir.\n" if ($verbose); system("$home_dir\\..\\..\\bin\\cp -rv directory$dir copieddir +ectory$dir"); } else { system("/bin/cp -r directory$dir copieddirectory$dir"); or warn "Could not copy directory$dir to copieddirectory$dir +: $?\n"; } # Rename the directory if (!-d "copieddirectory$dir") { print "copieddirectory$dir does not exist!\n" if $verbose; } if ($^O =~ /Win32/) { system("move copieddirectory$dir ..\\test1\\moveddirectory$dir + > out.txt"); if (-e "out.txt") { unlink("out.txt") or die "Can't unlink out.txt: $!\n"; } } else { system("/bin/mv copieddirectory$dir ../test1/moveddirectory$di +r"); or warn "Could not move directory$dir to test1: $?\n"; } # Delete the copied directory if ($^O =~ /Win32/) { rmdir("..\\test1\\moveddirectory$dir"); } else { system("/bin/rm -r ../test1/moveddirectory$dir"); or warn "Could not remove test1\\directory$dir: $?\n"; } # Remove the directory if ($^O =~ /Win32/) { rmdir("directory$dir") or die "Can't remove directory: $!\n"; } else { system("/bin/rm -r directory$dir"); or warn "Could not remove directory$dir: $?\n"; } } print "complete!\n" if ($verbose); # Change back to the top directory chdir($home_dir) or die "Can't move back to $home_dir: $!\n"; sub usage { print " $0 [options] Options: -num The number of loops to run, default $num -testdir Location to run the test within -verbose Run with messaging \n"; exit(0); }

In reply to Re^2: System call constantly dying by gokuraku
in thread System call constantly dying by gokuraku

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.