> I get this warning:
> Reference found where even-sized list expected at ./n.pl line 94.
>
> when running my script, and i don't understand what does it mean.
> Please explain. Here are the relevant lines:
>
> 94: my %args = {
> 95: descriptor => "/usr/lib/nitro/all.xml",
> 96: build => {
> 97: cleanup => 1,
> 98: bindir => "$origwd/binaries"
> 99: }
> 100: };
>
You've declared %args as a hash, so Perl expects the initializer to be
a list of key,value pairs:
%h = (a => 1, b => 2);
$x = $h{'a'}; # $x gets 1
Instead, you've provided a hash reference. Perl sees that as a key in
the initializer list, and it wants the value (hence the "even-sized
list" error.)
References are scalar values, so use $args, not %args, e.g.
$h = {a => 1, b => 2);
$x = $h->{'a'}; # $x gets 1
Regards,
Jonathan