I am trying to write a function for commit with logmesg using the Alien SVN::Client perl API. I am struct with the array of object function

For Your Reference

$ctx->log_msg(\&log_msg) Sets the log_msg callback for the client context to a code reference that you pass. It always returns the current codereference set. The subroutine pointed to by this coderef will be called to get the log message for any operation that will commit a revision to the repo. It receives 4 parameters. The first parameter is a reference to a scalar value in which the callback should place the log_msg. If you wish to cancel the commit you can set this scalar to undef. The 2nd value is a path to a temporary file which might be holding that log message, or undef if no such field exists (though, if log_msg is undef, this value is undefined). The log message MUST be a UTF8 string with LF line separators. The 3rd parameter is a reference to an array of svn_client_commit_item3_t objects, which may be fully or only partially filled-in, depending on the type of commit operation. The 4th and last parameter will be a pool. If the function wishes to return an error it should return a svn_error_t object made with SVN::Error::create. Any other return value will be interpreted as SVN_NO_ERROR.

my $ctx= new SVN::Client(); $ctx->log_msg(\&log_msg); print "enterpath \n "; my $path = <>; chomp($path); $ctx->commit($path,0); sub log_msg { my ($logmsg,$messgpath,$citems,$pool)=@_; ($fh, $filename) = tempfile() or die "Error creating $filename: $! +"; $fh= new IO::File "+>> $filename " or die " could not open a file :$!" +; #if (defined $fh){ #my $line =<STDIN>; #print $fh $line; #} $logmsg =\$fh; $messgpath =$filename; $citems= \@svn_client_commit_item3_t; ## i am struck here }

can some body help me in writing the svn_client_commit_item3_t array of object function i tried a lot i am unable to understand what the function should return or what it should take , how to write. can some body help me with this code


In reply to help in writing Array of object by naresh777

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.