fouinix has asked for the wisdom of the Perl Monks concerning the following question:
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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Use SVN::Client to "cat" a file on svn
by choroba (Cardinal) on Feb 04, 2014 at 15:44 UTC | |
by fouinix (Initiate) on Feb 04, 2014 at 16:15 UTC | |
by choroba (Cardinal) on Feb 04, 2014 at 16:33 UTC | |
|
Re: Use SVN::Client to "cat" a file on svn
by kcott (Archbishop) on Feb 05, 2014 at 07:16 UTC | |
|
Re: Use SVN::Client to "cat" a file on svn
by GotToBTru (Prior) on Feb 04, 2014 at 15:49 UTC |