http://qs321.pair.com?node_id=11120121


in reply to Simple way to skip spaces and # comments

I usually just s/// that kind of thing,
my $line = 'valid text blah blah # delete me and everything after poun +d # also this'; $line =~ s/#.*$//; print qq{"$line"\n};
results in:
"valid text blah blah "
I don't have an answer for your #2 question at the end.