in reply to generating list box form oracle database

Like the monks have said, DBI is the way to go. This is the standard way to connect to a database in Perl, and has been for a while. This example uses DBI to do the same thing with a mysql database, the only difference in using Oracle is that the connection routine would have to change and you would have to use DBD::Oracle. (you have to set some env variables when connecting, ORACLE_HOME, and ORACLE_SID, i believe, but check out the docs).

Anyway, the get_catnames() routine which returns a reference to an array which is handed over to the CGI.pm popup_menu() function would work just the same in oracle, providing it was working with a valid $dbh.

#!/usr/bin/perl -Tw use strict; use CGI qw# :standard :form #; use DBI; use DBD::mysql; my $dbh = get_handle('dbname', 'dbuser', 'dbpasswd'); my $listref = get_catnames( \$dbh ); # sending a ref print header; print start_html; print popup_menu( -name=>'categories', -value=>$listref ); $dbh->disconnect; ##### ##### sub get_catnames { my $dbh = shift; my @cats = (); my $statement = "select category_name from mtx_catnames"; my $sta = $$dbh->prepare($statement); # deref this $sta->execute; my $cats = $sta->fetchall_arrayref; for my $row ( @{ $cats } ) { push @cats, $row->[0]; } return \@cats; } sub get_handle { my ($DB, $DBUSER, $DBPASS) = @_; my $dsn = "DBI:mysql:database=$DB;host=localhost"; my $dbh = DBI->connect($dsn, $DBUSER, $DBPASS) or die( qq|cannot connect to database $DB| ); return $dbh; }