use DBI;

 my $dbh = DBI->connect('DBI:Proxy:hostname=makabaer.cc.univie.ac.at;port=1002;dsn=dbi:Oracle:', 'user'
, 'passwd')
        or die "Couldn't connect to database: " . DBI->errstr;


 my $sth = $dbh->prepare('SELECT per_name, per_nicat_handle FROM NIC_Personen WHERE PER_NAME = :name')
                or die "Couldn't prepare statement: " . $dbh->errstr;


          my @data;
          $sth->bind_param(':name', "Hofstetter");
          $sth->execute($lastname)             # Execute the query
            or die "Couldn't execute statement: " . $sth->errstr;


          while (@data = $sth->fetchrow_array())
                {
            my $firstname = $data[1];
            my $id = $data[2];
            #print "$data[1] $id $data[3]\n";
            print @data;
        }

        $sth->finish;