in reply to Re^3: SVN API log_msg help
in thread Reaped: SVN API log_msg help

Thanks very much. I slightly modified and now i am able to commit.

${ $log_msg } = join("", @lines); return; # i changed this to my $data =join("",@lines); return $data;

Now the question comes is when i enter a comment at

 my @lines =<STDIN>;

It is still waiting to take data until i used "ctrl +D" how can i automate it to close and continue executing and the second thing is the temporary file which it is creating to save message it is dont deleting from temp after program exits

Replies are listed 'Best First'.
Re^5: SVN API log_msg help
by pemungkah (Priest) on Dec 23, 2011 at 20:09 UTC
    It depends on what you want to do. If you want it to read only one line and then proceed, use
    ${ $log_msg } = <STDIN>;
    That will read just one line. If you instead want to do something like "read until I enter a null line", use a while loop, read one line at a time, and look for an empty one (only contains "\n").

    For the second option, try File::Temp.

    ($fh, $filename) = tempfile($template, UNLINK => 1);
    should work for you. That will automatically unlink the file when the program ends. If you don't want the filehandle (though I think you do), just use undef as the first item in the list being assigned to. Since you're going to write to the file, I'd suggest just using the handy already-opened-for-write filehandle that the call to tmpfile returns.