Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Changes in logic... road map?

Quote Reply
Changes in logic... road map?
 
There have been numerous changes in the calling conventions, and one of the best ways to start to see the differences, is by comparing the programs like jump.cgi, add.cgi, etc.

One thing I've noticed, is that there is now a method for passing options to the query, and the field you want to query is passed as a hash key/value.

Also, I noticed, the prepare/execute() format is not used. The statement is built in pieces, then when the select method is called, it's run as part of the method.

This sort of syntax, for calling a random link:

$db->select_options ("LIMIT $offset, 1");
$sth = $db->select ( ['URL'] );
($goto) = $sth->fetchrow_array;

Is going to take awhile to get a handle on, since it seems what's passed in determines what is passed back -- in terms of fields, as well as query results. The above "obviously" returns the single value of URL from the query, and assigns it directly to $goto, bypassing the assignment step in 1.1x where the whole record was returned.

If anyone else is poking around, maybe point out things you find, to help steer people in the right direction.

BTW... one thing I'm at the point of taking for granted now, is that there are a few "global" variable objects, defined in the routines -- $USER, $CFG, $TPL, etc. These are initialized using an AUTOLOAD feature in the "use Links qw/.../" statement. _HOW_ these are actually used, I'm working on :) but it's the first step to understanding. It's a different process than the 1.1x version, and it makes a lot more information available to each process (which I'm sure has it's down side, as well as it's benefits).




PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ


Quote Reply
Re: Changes in logic... road map? In reply to
In Reply To:
using an AUTOLOAD feature
Actually, an import feature, not autoload. =) The autoload allows you to do:

my $obj = Links->DB;

but I'm most likely dropping that as it's not really neccessary.

See perldoc GT::SQL for info on how to use it.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Changes in logic... road map? In reply to
Sorry... know what happens when you stay up late and type... your fingers do something you didn't mean them to do :)

AUTOLOAD, import, rm *.*,.... what's the difference???



PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ