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 6144203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:37:02+00:00 2026-05-23T18:37:02+00:00

I’m testing out a proof-of-concept that sends two files over a TCP connection to

  • 0

I’m testing out a proof-of-concept that sends two files over a TCP connection to a remote server, all using Perl. I’m running into a problem, however, with sending multiple files over. Currently, I have the client (hosted on Windows, running ActiveState Perl) that wants to send over 2 CSV files to the remote server (running some form of RedHat). As the process goes, the client will print out, line-by-line, the contents of the CSV file, and when that’s done, it’ll send over a message to the server. The server should then intercept that message, and switch the file to write to to another CSV file.

However, the server is just one large file, where I want it to split what it receives into two files. So, my real question is this: what is the easiest way, using Perl, to send over two files on a TCP connection? I’d PREFER to use builtin modules, such as IO::Sockets, but if I have to download an external module to make the process simple, I can do that too.

Thank you for any and all answers!

[EDIT]: It seems it was line endings that were affecting me, along with the fact that the last line of a file doesn’t have a “\n” appended to it. Replacing Windows line endings with Unix ones seemed to do the trick, along with some other formatting with the “End Of File” message. Thanks to all those who answered!

  • 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-23T18:37:03+00:00Added an answer on May 23, 2026 at 6:37 pm

    Send a header with the length of the first file. Since they’re text files, and this is Perl, it might be better to use the number of lines in the file. On the other side, read that number of lines in as the first file, then all of the rest as the second. This principle can be extended for any number of files.

    Edit: You’ll also want to translate the windows line endings to linux ones. A simple s/\r\n/\n/; should do the trick.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I've tracked down a weird MySQL problem to the two different ways I was

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.