Re: Removing auto-generated methods (set_sql)

[prev] [thread] [next] [Date index for 2004/06/14]

From: Perrin Harkins
Subject: Re: Removing auto-generated methods (set_sql)
Date: 20:56 on 14 Jun 2004
On Mon, 2004-06-14 at 16:51, William McKee wrote:
> I had considered that possibility but then how can I call a dynamic
> method? I don't think Perl would accept the following (at least in
> strict mode):
> 
>     my $sql = qq~SELECT * FROM t1, t2~;
>     my $sql_name = join("_", @fieldnames);
>     MyDBI->set_sql($sql_name => $sql);
>     MyDBI->$sql_name(@fieldvals);

It will.  Using a variable for a method name is allowed under strict.

> I think I know what you are referring to but in this case I'm pretty
> sure it's line 936 in CDBI:
> 
> 	defined &{"$class\::$method"}
> 		and return $class->_carp("$method() already exists");

Interesting.  I'm not sure why that's there, but if you took it out you
would just get the warning from Perl instead.

- Perrin

(message missing)

Removing auto-generated methods (set_sql)
William McKee 16:27 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
Tony Bowden 16:33 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
William McKee 16:57 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
Perrin Harkins 17:30 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
William McKee 20:51 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
Perrin Harkins 20:56 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
William McKee 21:48 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
Tony Bowden 21:59 on 14 Jun 2004

Re: Removing auto-generated methods (set_sql)
Tony Bowden 08:53 on 15 Jun 2004

Re: Removing auto-generated methods (set_sql)
William McKee 17:53 on 15 Jun 2004

Re: Removing auto-generated methods (set_sql)
Tony Bowden 19:59 on 15 Jun 2004

Re: Removing auto-generated methods (set_sql)
Perrin Harkins 00:04 on 16 Jun 2004

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