I would like to merge these 2 regexp in one
next if $line =~ /^#/ or $line =~ /^\d+\-\d+/;
I would like to merge these 2 regexp in one
next if $line =~ /^#/ or $line =~ /^\d+\-\d+/;
"or" is easy: use the alternation |:
next if $line =~ /^#|^\d+-\d+/
You can even factor ^ out:
/^(?:#|\d+-\d+)/