sub _gather_user_groups {
my ($self, $user) = @_;
my $groups = output_from_command [groups => $user];
+ $groups =~ s{^ \Q$user\E \s* : \s* }{}x;
return [split m{\s+}, $groups];
}
#!/usr/bin/env perl
use strictures 1;
my $user = shift @ARGV;
-printf "%s\n", join ' ', map { "${user}_group_${_}" } qw( A B C );
+printf "$user : %s\n", join ' ', map { "${user}_group_${_}" } qw( A B C );