First, there is no conversion.
my @siteinfos = ();
defines an array @siteinfos and sets to the empty list. Of course, you could have achieved the same result by using just
my @siteinfos;
Next, the statement
push( @siteinfos, \%info );
pushes a reference to the hash %info to @siteinfos as the sole element of that array.
Next, the loop
foreach my $sinfo (@siteinfos) { # assuming original is a typo
ends up aliasing $sinfo to that sole hash reference in @siteinfos. In the body of the loop, you access an element of the original hash via the reference you pushed to @siteinfos.
Now, things would have been different if you had done:
push @siteinfos, %info;
That would have set @siteinfos to a list like the following (the order is non-deterministic):
$VAR1 = [
'ip',
undef,
'clip',
0,
'isLocal',
0,
'name',
undef,
'parent',
''
];
The undef are there because the match variables were empty when I ran the script. Now, if you want to push another key-value pair to this array, that's trivial:
push @siteinfos, $key, $value;
But of course, by assigning the hash to an array, you are losing the ability to simply look up values by key. In addition, you can keep pushing duplicate keys to an array, but if you assign it back to another hash:
my %otherinfo = @siteinfos;
then only the last version of an even-indexed element (key) and its corresponding odd-indexed element (value) will survive.
sinfosvar come from?