I want to log options and their arguments from user command after running the script.
Consider this command:
./test.pl --ip localhost --id 400154 --class firstgrade
...and many other options and values. My desired output would be like this(by using log4perl):
debug - ip=>localhost id=>400154 class=>firstgrade
I do:
use Getopt::Long;
my $ip;
my $id;
my $class;
my %h =('ip' => \$ip,
'id' => \$id,
'class' => \$class);
GetOptions(\%h);
$logger->debug(join('=>',%h));
but it doesn't work. Please help.