open(HOSTS, '/etc/hosts') || die("Out of cucumber error\n"); my %hosts; while(<HOSTS>) { s/#.*//; next unless /(\S+)\s+(.*)/; my $host = $1; push @{$hosts{$host}}, split(/\s+/, $2); } use Data::Dumper; print Dumper(\%hosts);
In reply to Re: newbie hasher
by DrHyde
in thread newbie hasher
by prodevel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |