Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

simple global making my head hurt...

Quote Reply
simple global making my head hurt...
Hi there. I'm sure PHP must seem like a toy language to most perl developers. But when you're used to PHP, perl can sure seem unnecessarily complex...

I'm trying to write a simple global to do the following:

1) Check if the logged in user has any records in the "events" table.
2) If he does, return a list of the titles of those events.

Here's what I've got:

Code:
sub {
use GT::SQL;
my $tags = shift;
my $user = $tags->{Username};
my $db = new GT::SQL '/path/to/admin/defs';
my $table = $db->table ('events');
my $output = "";
my $results = $table->query ({Owner_userid => $user});
if ($results) {
foreach my $result (@$results) {
$output .= "<br>$result[2]";
}
}
return $output;
}


I'm sure that's not the most direct way to accomplish this, but it seems like it's close to working.

Nonetheless, here's the error I'm getting:

Global symbol "@result" requires explicit package name at (eval 15) line 12. Unable to compile 'events_list'. Reason: at /path/to/admin/Dbsql/Home.pm line 1505.

I would be very grateful if someone could tell me what I'm doing wrong. Thanks!

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Subject Author Views Date
Thread simple global making my head hurt... hennagaijin 5807 Nov 15, 2002, 2:18 PM
Thread Re: [hennagaijin] simple global making my head hurt...
jaspercram 5693 Nov 15, 2002, 3:35 PM
Post Re: [jaspercram] simple global making my head hurt...
hennagaijin 5696 Nov 15, 2002, 3:38 PM
Thread Re: [hennagaijin] simple global making my head hurt...
jai 5703 Nov 15, 2002, 5:31 PM
Thread Re: [jai] simple global making my head hurt...
hennagaijin 5661 Nov 16, 2002, 5:11 AM
Thread Re: [hennagaijin] simple global making my head hurt...
ArtistikDD 5391 Apr 10, 2003, 1:28 PM
Thread Re: [ArtistikDD] simple global making my head hurt...
jai 5347 Apr 10, 2003, 4:56 PM
Post Re: [jai] simple global making my head hurt...
ArtistikDD 5321 Apr 11, 2003, 9:46 AM