in reply to Re^2: Selecting DB
in thread Selecting DB

Yes. The next problem is:

my $rez = join( ",", $em);

Most likely you wanted:

my $rez = join( ",", @$em);

Maybe you want to read tye's References Quick Reference, and/or use Data::Dumper a lot?

Replies are listed 'Best First'.
Re^4: Selecting DB
by frank1 (Monk) on Jul 08, 2023 at 14:20 UTC

    Thanks it worked!

Re^4: Selecting DB
by frank1 (Monk) on Jul 08, 2023 at 14:53 UTC

    it worked, but am getting emails like this

    test@test.com test2@test2.com

    no comma, coz i wanted to join emails with comma

      If you want all the emails comma (and possibly comma + newline) separated, avoid the foreach loop, and simply concatenate the results:
      my $rez = join(",\n", @$user1, @$user2); # Remove the \n if you want + just CSV

                      "These opinions are my own, though for a small fee they be yours too."

        this option just output this error

        ARRAY(0x559d1462e390), ARRAY(0x559d1462e348)