use Win32::Autoglob; use Cwd; my $keepgoing="keepgoing"; my @globline;my @argdata; my $mastercount =0; my $chunklock="orderlock.cfg"; my $successcheck = "successcheck.cfg"; my $chunksuccesscount="successlog1.cfg"; my $orderline="orderline.cfg"; my $trackingversion = 0; # 0 is ORDER 1 = Tracking # DoOrd.pl * #### SHIPPINGVERSION #system("pause"); if ($trackingversion == 0) { foreach my $thing (@ARGV) {if (($thing =~ /A-/) && ($thing =~ /.txt/)) {push (@argdata, $thing)} } # REPLACE FILENAME (ADD A UNIQUE NUMBER) + MOVE TO LIMBO foreach (@argdata) { @datain=();$oldfilename = $_;open(DGRAB, $oldfilename ) || die ("Could not open $oldfilename (DATA TO GRAB) \n"); while () {push(@datain, $_)};close DGRAB; my $movefilename = @datain[2];$movefilename =~ s/ /-/g;$movefilename =~ s/[^\w\d()-]+//g;my $range = 8999;my $minimum = 1000;my $random_number = int(rand($range)) + $minimum; $movefilename = "A-" . $movefilename . "--" . $random_number . ".txt"; push (@newargdata, $movefilename);system("move $oldfilename limbo/$movefilename"); } # FOREACH # ASSIGN NEW FILENAME FROM ORDERNAME @argdata = @newargdata; # DUPLICATE FOR MULTIPLE QUANTITIES foreach (@argdata) {@datain=();my $originalfilenamequantity= "";$filenamequantity = "limbo/" . $_;open(DGRAB, $filenamequantity ) || die ("Could not open $filenamequantity (DATA TO GRAB) \n"); while () {push(@datain, $_)};close DGRAB;print "$filenamequantity LOADED \n"; foreach (@datain) { if ($_ =~ /QUANTITY:::/) {print "Q \n";@quantitysplit1 = split(/QUANTITY:::/, $_);@quantitysplit2 = split(/:::/, @quantitysplit1[1]);$quantityvalue=@quantitysplit2[0];print "@quantitysplit1[1] Quantityvalue: $quantityvalue \n\n";}} # DUPLICATE ORDER BASED ON QUANTITY AMOUNTS if ($quantityvalue > 1) {my $originalfilenamequantity=$filenamequantity; # CREATE DUPLICATES BASED ON QUANTITY for ( my $count = 1; $count <= $quantityvalue; $count++) {@copydatain=();open(DGRAB, $filenamequantity ) || die ("Could not open $filenamequantity (DATA TO GRAB) \n"); while () {push(@copydatain, $_)};close DGRAB; my $copydatainstring = join('',@copydatain);my $quantitytoreplacestring = "QUANTITY:::" . $quantityvalue . ":::";$copydatainstring =~ s/$quantitytoreplacestring/QUANTITY:::1:::/; my $duplicatefilenamequantity = $filenamequantity . $count;open (DGRAB, ">$duplicatefilenamequantity");print DGRAB "$copydatainstring";close(DGRAB); } # IF $quantityvalue > 1 ########## PROBLEM IS HERE ########## PROBLEM IS HERE ########## PROBLEM IS HERE # MOVE ORIGINAL TO ../Done/M-archiv # $originalfilenamequantity =~ s/limbo\///; # tried short fuilenames long filenames... yada yada $currentdir = getcwd;$originalfilenamequantity = $currentdir . "/" . $originalfilenamequantity;print "Currentdir : $currentdir \n FILE: :$originalfilenamequantity: \n"; print "move $originalfilenamequantity 1.txt \n"; system("move $originalfilenamequantity .."); } # FOREACH (@datain) } # foreach die; ########## PROBLEM IS HERE ########## PROBLEM IS HERE ########## PROBLEM IS HERE #### Z:\SALESD~1\LOGS\ORDERS\0-ORDER>DoOrd.pl * limbo/A-Chad-Black(GI)--2429.txt LOADED Q 1::: Quantityvalue: 1 limbo/A-Mickey-Carpenter(JJ)--4891.txt LOADED Q 2::: Quantityvalue: 2 Currentdir : Z:/SALESD~1/LOGS/ORDERS/0-ORDER FILE: :Z:/SALESD~1/LOGS/ORDERS/0-ORDER/limbo/A-Mickey-Carpenter(JJ)--4891.txt: move Z:/SALESD~1/LOGS/ORDERS/0-ORDER/limbo/A-Mickey-Carpenter(JJ)--4891.txt 1.tx t The system cannot find the path specified. limbo/A-Bob-Denk(HC)--3621.txt LOADED Q 3::: Quantityvalue: 3 Currentdir : Z:/SALESD~1/LOGS/ORDERS/0-ORDER FILE: :Z:/SALESD~1/LOGS/ORDERS/0-ORDER/limbo/A-Bob-Denk(HC)--3621.txt: move Z:/SALESD~1/LOGS/ORDERS/0-ORDER/limbo/A-Bob-Denk(HC)--3621.txt 1.txt The system cannot find the path specified. Press any key to continue . . . Died at Z:\SALESD~1\LOGS\ORDERS\0-ORDER\DoOrd.pl line 48. Z:\SALESD~1\LOGS\ORDERS\0-ORDER>