in reply to Re: Change a line in a file
in thread Change a line in a file
This solution added only one line to the original subroutine! Thank you. Warm regards,sub t_write { my($file, $aOrder) = @_; my($trace) = $aOrder->{trace_file_data}; if (!defined($trace) || length($trace) == 0) { print "No trace file.\n"; return; } $trace =~ s/JOB=.*/RMT=$file/; open(F, "> $file\0") or die "Can't create trace-file $file ($!)\n" +; print F $trace; close(F); #make a comment that this was done print "Trace file: $file\n"; }
|
|---|