use strict; my ($object_name, $object_type, $module_type, @list_of_objects, $database, $userid, $passwd); $database = 'DBI:Oracle:tdtxtasd'; print "Please enter your username:"; $userid = ; chomp($userid); print "Please enter your password:"; $passwd = ; chomp($passwd); use DBI; my $dbh = DBI->connect($database, $userid, $passwd) or die "Couldn't connect to database: " . DBI->errstr; my $sth = $dbh->prepare('SELECT object_name, object_type FROM user_objects WHERE object_type = ?') or die "Couldn't prepare statement: " . $dbh->errstr; $module_type = "PROCEDURE"; my $rc = $sth->execute($module_type); while (($object_name, $object_type) = $sth->fetchrow()) { #push @{list_of_objects},$object_name, $object_type; print "$object_name $object_type\n"; }; $dbh->disconnect; #### foreach i (1....n) { foreach j (1,2) { $object_name = @list_of_values[i][2]; } };