#!/usr/bin/perl # https://perlmonks.org/?node_id=1230807 use strict; use warnings; my @array1 = qw(host1 host2 host3); my @array2 = qw(ip1 ip2 ip3); my %ip2host; @ip2host{@array2} = @array1; print "$_ $ip2host{$_}\n" for @array2;
In reply to Re: Join 2 arrays horizontally
by tybalt89
in thread Join 2 arrays horizontally
by perl_5eeker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |