sub _print_nodeandip { my @ips; if(! open (FILE_FH, "$File")) { print "Failed to Open File $File for Reading.. Exiting.."; exit; } while () { chomp($_); my @line = split(/,/,$_); my $node=$line[1]; if ($node =~ /[A-Za-z]\_*\_*\_*\[A-Za-z0-9]/) { print "$node\n"; } } my Input Line has something like : 11bt801,MS_11BT801_5A0T801_0001,3,10.197.28.38,11BT801,1,16,1,1,3,10.197.28.37,mtx1.idc