# read trans barcode $primer = Util::Util::trim(Util::Util::fileDecode($transFile)); # set transaction folder path my $transPath = "plsTrans/" . $primer . "/tmp/"; use File::Path qw(mkpath); # create the target directory if there is none if (!-d $transPath) { mkpath $transPath or die "cannot create target directory $transPath:$!\n"; } use File::Copy qw(move); move($transFile, $transPath . $transFile) or die "move to $transPath failed: $!";