[luau] Perl Frustration!!

Vince Hoang luau at ml.altern8.net
Tue Aug 19 12:38:01 PDT 2003


On Tue, Aug 19, 2003 at 09:34:23PM +0000, knowtree at aloha.com wrote:
> The only thing I grumble about is the way assigning $row[n]
> to a variable doesn't support built-in position-independent
> data element names. A schema change can trigger a complete
> application re-write. Instead of
>
>   @row = $sth->fetchrow_array();
>   $cpusn = $row[0];
>   $ip = $row[1];
>
> I would like to be able to write
>
>   $cpusn = $sth->fetchitembyname("wkstncpu.sn");
>   $ip = $sth->fetchitembyname("wkstncpu.ipaddr");
>
> and have the location of the data in the record resolved by
> means of the database schema. Without taking a significant
> performance hit.

Perhaps I missed your point, but the results are
position-dependent of the SELECT query and not the schema. 

Also, using the *_hashref methods automagically stores the
results into hash where you can dereference by name.

-Vince



More information about the LUAU mailing list