Dear Monks, i have a construct which is more or less working (Dummy here, be kindly please).
%targets = ( '_source' => [], '_name'=> [] ); foreach my $ip1 (@ips){ foreach my $ref (@http){ for my $bla ( $ref->{'_source'}->{'clientip'} ) { if ($bla eq $ip1){ my $name = gethostbyaddr(inet_aton($bla), AF_INET); if ( $name !~ /.*\.dom1\.\.*.*./ ) { if ( $name !~ /.*\.dom2\.\.*.*./ ) { if ( $name !~ /.*\.dom3\.\.*.*./ ) { push @{ $targets{'_source'} }, $bla; push @{ $targets{'_name'} }, $name; } } } } } } }
What happens is that this code pushes all $bla to VAR1->_source and $name to VAR1->_name, like:
What i am trying to archive is to have a structure like:$VAR1 = { '_name' => [ 'carbon019.a.ahrefs.com', 'u17478488.onlinehome-server.com', ], '_source' => [ '181.167.186.3', '34.230.53.172', ] };
VAR1->_source->$bla _name->$name VAR2->_source->bla _name->$name
and so on....May i ask a monk to help? I tried some stuff, but it didnt work. Thanks!!!
In reply to Push to Reference by maikelnight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |