Re: Class::DBI imports first() from List::Util

[prev] [thread] [next] [Date index for 2004/04/28]

From: Todd W
Subject: Re: Class::DBI imports first() from List::Util
Date: 00:18 on 28 Apr 2004
>>Class::DBI imports first() from List::Util, which throws a warning whne a 
>>database column is named 'first'. Heres a patch that fixes that:
>>20c20
>>< use List::Util 'first';
>>---
> >> use List::Util;
>>439,440c439,440
>>< 			|| (first { $_->mutator  eq $k } $class->columns)
>>< 			|| (first { $_->accessor eq $k } $class->columns)
>>---
> >> || (List::Util->first({ $_->mutator  eq $k }, $class->columns))
> >> || (List::Util->first({ $_->accessor eq $k }, $class->columns))
>>1033c1033
>>< 			|| (first { $_->accessor eq $col } $class->columns)
>>---
> >> || (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.
>
>

::first. I sent the diff from before I tested it. Thanks.

Todd W.

_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE! 
http://toolbar.msn.com/go/onm00200414ave/direct/01/

Class::DBI imports first() from List::Util
sendwade 03:10 on 27 Apr 2004

Re: Class::DBI imports first() from List::Util
merlyn (Randal L. Schwartz) 04:33 on 27 Apr 2004

Re: Class::DBI imports first() from List::Util
Tony Bowden 08:15 on 27 Apr 2004

Re: Class::DBI imports first() from List::Util
Todd W 00:18 on 28 Apr 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52