> 
> "Phil Pinkerton"  wrote in message 
> news:7a962da1-a5fb-4046-bbf5-f888dd715...@gmail.com...
>> Very nice to know about CPAN.
>> 
>> got a syntax error though with your script
>> 
>> syntax error at ./getACLinfo.pl line 51, near "say join"
>> Execution of ./getACLinfo.pl aborted due to compilation errors.
>> 
>> [code]
>> #!/usr/bin/perl
>> 
>> use strict;
>> use SVN::Access;
>> my $acl = SVN::Access->new( acl_file => 'data' );
>> 
>> # Walk through the resources in the ACL file:
>> for my $repopath ($acl->resources) {
>>  # For this resource, find out what authorisations exist:
>>  for my $auth ($repopath->authorized) {
>> 
>>      # $repopath->authorized gives us hashrefs of group => perms
>>      # TODO: I don't know if it might also give individual users, if
>>      # had per-user grants.
>>      my ($group, $perms) = each %$auth;
>> 
>>      if ($group =~ s/^@//) {
>>          # For each group, list out the members, along with the repo
>>          # permissions
>> 
>>          for my $user ($acl->group($group)->members) {
>>              say join '~', $user, $repopath->name, $group, $perms;
>>          }
>>      } else {
>>          die "Can't handle individual user permissions!";
>>      }
>>  }
>> }
>> [/code]
> 
> Hello Phil,
> 
> Your script needs to use 5.010 or better to use the 'say' function.
> 
> Right after the 'use strict;' line, enter 'use 5.010;' or
> a newer version if that is what you have.
> 
added use 5.12.3

made some progress but still have errors
$ ./getACLinfo.pl 
Use of uninitialized value $current_resource in string eq at 
/Library/Perl/5.12/SVN/Access.pm line 70, <ACL> line 3.
Use of uninitialized value $current_resource in string eq at 
/Library/Perl/5.12/SVN/Access.pm line 73, <ACL> line 3.
Use of uninitialized value $resource_name in string eq at 
/Library/Perl/5.12/SVN/Access.pm line 259, <ACL> line 3.
Use of uninitialized value $resource_name in pattern match (m//) at 
/Library/Perl/5.12/SVN/Access.pm line 265, <ACL> line 3.
Use of uninitialized value $resource_name in concatenation (.) or string at 
/Library/Perl/5.12/SVN/Access.pm line 266, <ACL> line 3.
Invalid resource format in ! (format 'repo:/path')!

#!/usr/bin/perl
[code]
use strict;
use 5.12.3;
use SVN::Access;
my $acl = SVN::Access->new( acl_file => 
'/Users/pnkerton/scripts/ACLexample.txt' );

# Walk through the resources in the ACL file:
for my $repopath ($acl->resources) {
   # For this resource, find out what authorisations exist:
   for my $auth ($repopath->authorized) {

       # $repopath->authorized gives us hashrefs of group => perms
       # TODO: I don't know if it might also give individual users, if
       # had per-user grants.
       my ($group, $perms) = each %$auth;

       if ($group =~ s/^@//) {
           # For each group, list out the members, along with the repo
           # permissions

           for my $user ($acl->group($group)->members) {
               say join "~", $user, $repopath->name, $group, $perms;
           }
       } else {
           die "Can't handle individual user permissions!";
       }
   }
}
[/code]


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to