The doc (SVN::Client) says :
$ctx->cat(\*FILEHANDLE, $target, $revision, $pool); Outputs the content of the file identified by $target and $revision to the FILEHANDLE. FILEHANDLE is a reference to a filehandle.
When I put \*STDOUT it works. But I want to put the content of the $target to an array. I searched few hours on internet to find any example without success :(. With this code I have this error message : Bareword "FILE" not allowed while "strict subs" in use at script.pl line 16. Execution of script.pl aborted due to compilation errors.
Thanks a lot!#!/usr/bin/perl use 5.014; use strict; use warnings; use SVN::Client; my $ctx = new SVN::Client( auth => [SVN::Client::get_simple_provider(), SVN::Client::get_simple_prompt_provider(\&simple_prompt,2), SVN::Client::get_username_provider()] ); $ctx->cat(FILE, 'http://127.0.0.1/file.txt','HEAD'); my @text = <FILE>; sub simple_prompt { my $cred = shift; my $realm = shift; my $default_username = shift; my $may_save = shift; my $pool = shift; print "Enter authentication info for realm: $realm\n"; print "Username: "; my $username = <>; chomp($username); $cred->username($username); print "Password: "; my $password = <>; chomp($password); $cred->password($password); }
In reply to Use SVN::Client to "cat" a file on svn by fouinix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |