Re: Class::DBI imports first() from List::Util
[prev]
[thread]
[next]
[Date index for 2004/04/27]
>>>>> "sendwade" == sendwade <sendwade@xxxxxxx.xxx> writes:
sendwade> Class::DBI imports first() from List::Util, which throws a warning whne a database column is named 'first'. Heres a patch that fixes that:
sendwade> 20c20
sendwade> < use List::Util 'first';
sendwade> ---
>> use List::Util;
sendwade> 439,440c439,440
sendwade> < || (first { $_->mutator eq $k } $class->columns)
sendwade> < || (first { $_->accessor eq $k } $class->columns)
sendwade> ---
>> || (List::Util->first({ $_->mutator eq $k }, $class->columns))
>> || (List::Util->first({ $_->accessor eq $k }, $class->columns))
sendwade> 1033c1033
sendwade> < || (first { $_->accessor eq $col } $class->columns)
sendwade> ---
>> || (List::Util->first({ $_->accessor eq $col }, $class->columns))
Do you really want ->first, or ::first? If it was an ordinary
subroutine before, using it as a method call will introduce
an extra (unexpected) parameter.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@xxxxxxxxxx.xxx> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
|
|
Re: Class::DBI imports first() from List::Util
merlyn (Randal L. Schwartz) 04:33 on 27 Apr 2004
|