in reply to removing a column
use strict; use warnings; use Data::Dumper; my @ips; while (<DATA>) { next if /^#/; next if /^\s*$/; push @ips, (split)[0]; } print Dumper(\@ips); __DATA__ # comments: phony ip's 666.6.6.66 foo.bar 77.77.77.77 goo
prints:
$VAR1 = [ '666.6.6.66', '77.77.77.77' ];
|
|---|