PERL Example:
#!/usr/bin/perl
require "/etc/somedir/main.pm";
require cf;
# provide the database with the appropriate selections
# to retrieve only those students whom are CS and for credit
#
$sql = q{
select distinct uid
from Assoc, People where
Assoc.osuid=People.osuid and
(group_code='CLS-11111' and
subgroup like 'CS%' );
};
# perform the actual extraction of the data from PUD
#
@rows = cf::mysql_get( $sql ); # has \n after the data
# go through the rows pulling out the userid and append it to the server
# address for emailing...
#
for (@rows) {
chop; #clip off the \n from mysql_get
$Out = $_."\@okstate.edu"; #append server address
printf ("%15s\n",$Out); # output email address to stdout
}
exit 0;