From: Martin Ågren Date: Fri, 23 Sep 2022 11:42:37 GMT Subject: Re: [PATCH v2] cmd-list.perl: fix identifying man sections Message-ID: In-Reply-To: <220923.86fsgi4gl6.gmgdl@evledraar.gmail.com> On Fri, 23 Sept 2022 at 10:53, Ævar Arnfjörð Bjarmason wrote: > > Thanks for the quick turn-around, this looks good to me in this form. Thanks for reviewing. > Now, having written and looked at this with fresh eyes this would be an > even better & more logical thing to do: > open I, '<', "$name.txt" or die "No such file $name.txt"; > while () { > - if (/^(?:git|scalar)[a-z0-9-]*\(([0-9])\)$/) { > + if (/^\Q$name\E\(([0-9])\)$/) { > $mansection = $1; > next; > } Right, we know what we want there, so this does look reasonable. > Anyway, this is more than good enough for now, thanks! There's also much > bigger issues with the script, and we can leave that all aside from now > (e.g. if it dies the Makefile doesn't report an error, ouch!). Martin