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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:47+00:00 2026-05-29T06:55:47+00:00

I have a Perl program that I’ve written that parses SQL-like statements and creates

  • 0

I have a Perl program that I’ve written that parses SQL-like statements and creates a job to run on a mainframe that extracts fields and records based on the criteria. The records are returned to the PC and then output in various formats (e.g. csv, XML, etc.). I co-opted SQL’s INTO clause to list the files and outputs.

The issue is that writing records to a SQLite database (one of the output formats) takes a relatively long time and I don’t want that to hold up the processing of the next SQL command (in case there are multiple SQL queries passed in). So, I thought I would use fork() to make this happen.

The original bit of code is:

foreach (@into) {
    dointo($_,$recs);
}

@into is a list of files and formats (e.g. ‘File1.csv’ is a comma-delimited format sent to File1.csv, ‘File1.xml’ is an XML format written to File1.xml, etc.) to be processed. The subroutine dointo handles each of these. $recs is a sort of iterator that returns records in a variety of formats (flat, anonhash, anonarray, etc.)

So, I changed the code to:

foreach (@into) {
    unless (fork()) {
        dointo($_,$recs);
        exit 0;
    }
}

but now when the code runs, it seems to work, but it pulls a run-time error every time.

I didn’t capture the return from fork() because I really don’t care about waiting for the forked process to finish. Could this be the error? Does the parent process NEED to wait for the child processes to finish before it can safely exit?

Any help would be appreciated.

(BTW, Windows XP is the OS, Activestate Perl 5.10.0 is the Perl version)

  • 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-29T06:55:48+00:00Added an answer on May 29, 2026 at 6:55 am

    Don’t write to a SQLite database in parallel.

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

Sidebar

Related Questions

I'd like to have a perl program that I can call with something like:
I have a certain Perl program that I need to run on Windows 7
I have a Perl program that needs to run about half a dozen programs
I'm writing a combination Java/Perl program that parses XML files into an Oracle SQL
We have a Perl program that ran well on all Windows platforms so far.
I have a perl program that takes input and output file arguments, and I'd
I have a Perl program, that needs to use packages (that I also write).
I have a Perl program that is reading html tags from a text file.
We have an installation program that runs in Perl 32-bit. This program needs to
I have a Perl program that has a GTK2 GUI (via the Gtk2 package).

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.