sub t_write { my($file, $aOrder) = @_; my($trace) = $aOrder->{trace_file_data}; my $counter = 0; if (!defined($trace) || length($trace) == 0) { print "No trace file.\n"; return; } open(F, "> $file\0") or die "Can't create trace-file $file ($!)\n"; print F $trace; close(F); # new start testing >>>>>> open (T, "+<$trace"); my @array = ; #this has the readline error foreach my $line (@array) { if ($line =~ /^JOB=/) { $array[$counter] = "RMT=$file\n"; } $counter++; } print T @array; #this has the print() error close(T); # end testing <<<<< #make a comment that this was done print "Trace file: $file\n"; }