Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8663577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:01:13+00:00 2026-06-12T17:01:13+00:00

I have Perl code like so: $pre = $dbh->prepare(select distinct skills from people); $pre->execute;

  • 0

I have Perl code like so:

$pre = $dbh->prepare("select distinct skills from people");
$pre->execute;

my @preList;
while (my $row = $pre->fetchrow_array()) {
    push (@preList,$row);
}
print "Pre list: $_" foreach @preList;

When I try the exact same statement in sql it works perfectly, but when I run this program it prints out nothing (suggesting an empty @preList). I am probably doing something very stupid, but cannot see it. I have used this format for getting data before, which works perfectly. Can anyone see what I’ve done wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:01:15+00:00Added an answer on June 12, 2026 at 5:01 pm

    Right now you are doing, fetchrow_array which returns a list but you are trying to store it in a scalar, you can either change it to fetchrow_arrayref or change $row to @row, or change my $row to my ($row).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have some perl code that goes something like: use strict; use XML::XPath;
Here I have some Perl code: sub clustering { ($brapa,$gee) = @_; $g=0; while
I have code like: #!/usr/bin/perl use strict; use warnings; open(IO,<source.html); my $variable = do
In Perl module I have code like this: ... my $param = 123; my
Forgive a novice question as I am learning Perl. I have some code like
I have a piece of Perl code somewhat like the following (strongly simplified): There
I'm using GNU Emacs 22.2.1 and cperl 5.23. I have perl code like this:
Suppose I have a piece of Perl code like: foreach my $x (@x) {
I have a piece of code like this (Perl file): print 9 + 16
I have some perl code that looks something like this: my @array = map

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.