in reply to Moving Files

The problem is probably a "/n" or space in $primer. Just insert a print "(",$primer,")\n"; after setting $primer and see if the braces enclose your transfile number without any space left.

UPDATE: Also the '.' in "/tmp/." is superfluous. Does still work but it is rather unusual (like doing $f= 5+0;), so I just wanted to point that out.

Replies are listed 'Best First'.
Re^2: Moving Files
by rottmanja (Initiate) on Aug 07, 2008 at 18:17 UTC
    The brackets do enclose the transfile number with out any space left. I even added chomp just to be 100% sure.

    Here is my updated code

    # read trans barcode $primer = Util::Util::fileDecode($transFile); chomp($primer); print "(",$primer,")\n"; # set transaction folder path my $transPath = $wDir. "plsTrans/$primer/tmp/"; if(-d $transPath){ print "Transpath : " . $transPath . "\n"; print "FileName : ". $transFile . "\n"; print "Cmd : >cp $transFile $transPath<\n"; system("mv",$transFile,$transPath); }
      You might do print length($primer) to see if any invisible chars are in that string.

      UPDATE: Or use something like this to check for unusual ingredients:  if (not $primer=~/^[A-Z0-9-]+$/) print "AAAARGH\n";

        Ok, I think I have it figured out. Somewhere with in my $primer there is a char that should be there. Just have to find out what it is and remove it.