On Thu, Jul 19, 2012 at 05:26:12PM +0400, Матюхин Вячеслав wrote:
>Можно использовать 'undef | ...':

Нельзя: "Note single | not double as || cannot be overloaded. This will
only work when there is a special comparison involved" (из POD-а).

Да и разницы нет:

>$ perl -le 'use Test::Deep::NoTest; print eq_deeply({a => 1}, subhashof({ a => 
>undef | re(qr/\d/), b => undef | re(qr/^[XYZ]$/) }))'
>1

$ perl -le 'use Test::Deep::NoTest; print eq_deeply({a => 1}, subhashof({ a => 
re(qr/\d/), b => re(qr/^[XYZ]$/) }))'
1

Это обычный subhashof получился. И я думаю, вы имели в виду
superhashof().

-- 
maxim.vuets.name
-- 
Moscow.pm mailing list
[email protected] | http://moscow.pm.org

Ответить