Re: perl: unsafe empty pattern behavior

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: perl: unsafe empty pattern behavior
Дата
Msg-id 1941562.1710284344@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: perl: unsafe empty pattern behavior  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: perl: unsafe empty pattern behavior  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
Jeff Davis <pgsql@j-davis.com> writes:
> On Tue, 2024-03-12 at 18:53 +0100, Alvaro Herrera wrote:
>> 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.

> I think that's fine. qr// seems the most dangerous, because it seems to
> behave differently in different versions of perl.

I wonder whether perlcritic has sufficiently deep understanding of
Perl code that it could find these hazards.  I already checked,
and found that there's no built-in filter for this (at least not
in the perlcritic version I have), but maybe we could write one?
The rules seem to be plug-in modules, so you can make your own
in principle.

            regards, tom lane



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: perl: unsafe empty pattern behavior
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Add new error_action COPY ON_ERROR "log"