Skip to content
Snippets Groups Projects
Commit 41ea869a authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

prefer Data::Dumper over custom code

parent a9e54086
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ use lib qw(lib);
use feature "switch";
no warnings 'experimental::smartmatch';
use Data::Dumper;
use English qw(-no_match_vars);
use Getopt::Long qw(:config auto_help);
use Pod::Usage;
......@@ -171,8 +172,7 @@ sub parse_federation_metadata {
## List SAML entities
printf "Hashref representing the metadata:\n";
IdPAccountManager::Tools::dump_var($data, 0, \*STDOUT);
print Data::Dumper->Dump($data);
}
sub add_service_provider {
......
......@@ -100,37 +100,6 @@ sub update_ssp_authsources {
}
## Dump a variable's content
sub dump_var {
my ($var, $level, $fd) = @_;
if (ref($var)) {
if (ref($var) eq 'ARRAY') {
foreach my $index (0 .. $#{$var}) {
print $fd "\t" x $level . $index . "\n";
dump_var($var->[$index], $level + 1, $fd);
}
} elsif (ref($var) eq 'HASH') {
foreach my $key (sort keys %{$var}) {
print $fd "\t" x $level . '_' . $key . '_' . "\n";
dump_var($var->{$key}, $level + 1, $fd);
}
} else {
if (defined $var) {
print $fd "\t" x $level . "'$var'" . "\n";
} else {
print $fd "\t" x $level . "UNDEF\n";
}
}
} else {
if (defined $var) {
print $fd "\t" x $level . "'$var'" . "\n";
} else {
print $fd "\t" x $level . "UNDEF\n";
}
}
}
## Send a mail notice
## Default is to send email to the manager admins, unless other recipients are specified
## mail_notice(IN)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment