in reply to simple (in theory) regexp question

Ok, here we go: $contents =~ s/^(?!--|\n).*\n//mg; That looks ahead for two dashes or a newline at the start of every "line". If it DOES NOT FIND THEM, it matches the rest of the line and replaces it with nothing. The /m modifier is necessary so that ^ matches at the beginning of "lines".

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;