I can do this from a "regular" Perl script but I am having a "Perl growing
pain" moment on getting what I want to work with CA/HT.

I have the following in a module called WebDB.pm:

sub attu_all {
    my ($last, $first, $email, $userid);

    $sth = $dbh->prepare( qq{
        SELECT surname, first_name, msf810.email_address, msf810.employee_id
        FROM msf810, msf020, MSF829
        WHERE msf810.employee_id = msf020.employee_id
        AND msf810.employee_id = msf829.employee_id
        AND msf020.dstrct_code = 'ATTU' AND physical_loc = '05'
        AND global_profile != 'JRADMIN'
    } );

    $sth->execute();
    $sth->bind_columns( \$last, \$first, \$email, \$userid );

    my $count = 0;

    ### The print statements have been changed to make it more readable
    while($sth->fetchrow_arrayref) {
        if ($count % 2) {
            print "something";
        }
        else {
            print "something else";
        }
        $count++;
    }
}

Do I need to stuff the results of that while loop into a "return" statement
or can I just call the following in my application script:

my $page_content = WebDB::attu_all();

$template->param( CONTENT => $page_content, );

Any pointers would be much appreciated.

Robert




---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to