Re: optional third argument for has_many
[prev]
[thread]
[next]
[Date index for 2004/10/02]
hmmm, I thought "syntactic sugar" was supposed to clarify programmatic
constructs... foo( x=>y=>z), just looks like a typo to me... :)
thanks for clearing it up for me though.
On Sat, 2 Oct 2004 08:17:56 +0200, David Jack Olrik <david@xxxxx.xx> wrote:
>
> On Oct 2, 2004, at 0:07, Y00R0B0T wrote:
> > I've seen other code posted on this list looking like this
> > __PACKAGE__->has_many(col_id=>'PACKAGE::NAME'=>other_col);
> >
> > can that call also just be:
> > __PACKAGE__->has_many(col_id=>'PACK::NAME', 'other_col'); ?
>
> Yes it can. In perl5 '=>' is just syntactic sugar for ','
> So you could also write:
>
> __PACKAGE__->has_many(col_id , 'PACK::NAME' , 'other_col');
>
> --
> Best regards,
> David Jack Olrik <david@xxxxx.xx> http://david.olrik.dk
> GnuPG fingerprint C290 0A4A 0CCC CBA8 2B37 E18D 01D2 F6EF 2E61 9894
> ["The first rule of Perl club is You do not talk about Perl club"]
>
>