Re: perl: unsafe empty pattern behavior

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: perl: unsafe empty pattern behavior
Дата
Msg-id 202403121753.lw7u5b5fjsjw@alvherre.pgsql
обсуждение исходный текст
Ответ на perl: unsafe empty pattern behavior  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: perl: unsafe empty pattern behavior  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On 2024-Mar-12, Jeff Davis wrote:

> Do not use perl empty patterns like // or qr// or s//.../, the behavior
> is too surprising for perl non-experts.

Yeah, nasty.

> There are a few such uses in
> our tests; patch attached. Unfortunately, there is no obvious way to
> automatically detect them so I am just relying on grep. I'm sure there
> are others here who know more about perl than I do, so
> suggestions/corrections are welcome.

I suggest that pg_dump/t/002_pg_dump.pl could use a verification that
the ->{regexp} thing is not empty.  I also tried grepping (for things
like qr{}, qr[], qr||, qr!!) and didn't find anything beyond what you
have ... but I only looked for the "qr" literal, not other ways to get
regexes.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
Bob [Floyd] used to say that he was planning to get a Ph.D. by the "green
stamp method," namely by saving envelopes addressed to him as 'Dr. Floyd'.
After collecting 500 such letters, he mused, a university somewhere in
Arizona would probably grant him a degree.              (Don Knuth)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: On disable_cost
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel