foreach (@col) { print "This is element : $i\n"; if (/vlan/) { print "found a vlan line\n"; } if (/ifconfig/) { print "found an ifconfig line\n";