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

  • Home
  • SEARCH
  • 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 3229596
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:49:45+00:00 2026-05-17T16:49:45+00:00

I have a Client-Server Perl program. I want to send a message stored in

  • 0

I have a Client-Server Perl program. I want to send a message stored in an array to the server.

Server code:

use IO::Socket::INET;

# Creating a a new socket
$socket=new IO::Socket::INET->new(LocalPort=>5000,Proto=>'udp');

print "\nUDPServer Waiting for client on port 5000";

while(1)
{
    $socket->recv($recieved_data,1024);
    $peer_address = $socket->peerhost();
    $peer_port = $socket->peerport();
    print "\n($peer_address , $peer_port) said : $recieved_data";
}

Client code::

use IO::Socket::INET;

# Create a new socket
$socket=new IO::Socket::INET->new(PeerAddr=>'127.0.0.1',PeerPort=>5000,Proto=>'udp');

@message_array = ("message", 120, "sample");
$socket->send(@message_array);

In server side I changed like,

$socket->recv(@recieved_data,1024);

But I am getting an error like this,

UDPServer Waiting for client on port 5000usage: $sock->recv(BUF, LEN [, FLAGS]) at udp_server.pl line 17

How to send an array and getting it printed or displayed in the server side.?

  • 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-05-17T16:49:45+00:00Added an answer on May 17, 2026 at 4:49 pm

    You have to serialize the data. You send the serialized chunk of data over the wire then unserialize it.

    There are many options for this. The Indonesian Perl mongers recently made a comparison of serialization modules

    Perl comes with Storable, which can work just fine although you have to be careful that the module hasn’t changed in some way so that one version’s serialization works with another version.

    There are data formats such as YAML or JSON that might be better since they don’t depend on module versions. Both can handle complex data structures, although YAML can deal with Perl objects and JSON can’t (although JSYNC can). Each option has different trade-offs.

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

Sidebar

Related Questions

I have a classic client/server (fat client and database) program written in Delphi 2006.
I have a client and server program (both in Obj-C) and I am transferring
i have application with client-server architecture. client (C program): generate various DER encoded data
I code primarily in PHP and Perl. I have a client who is insisting
I have client and server programs which now communicate via TCP. I'm trying out
We have a client/server application with a rich client front end (in .Net) and
I have a client/server application that communicates with .Net remoting. I need my clients
I have a client server application that sends XML over TCP/IP from client to
I have a client-server application that uses .net remoting. The clients are in a
I have a client server based windows forms application that needs an administrator only

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.