while (chomp(my $temp=)){ print Dumper $temp; $temp =~ s/#.*//; # remove comments if ($temp =~ /^\s*$/){ next; } print "after regex:\n"; print Dumper $temp; print "end\n"; }