Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-20-2006, 01:00 PM   #1
Registered: Jul 2003
Location: Chicago
Distribution: Fedora, ubuntu
Posts: 458

Rep: Reputation: 30
Perl forcing loop to next b4 first job is done.

I have an array of files which loops though them grabbing relevant data and creating a new file for each. These files are very big and Im curious if you can force perl to process more than one (or all) at the same time.
@Files = ("file1", "file2", "file3");

foreach $File (@Files) {
  open(INFILE, $File) or die "Can't open source file: $File \n";
  open(OUTFILE, "> $File.good") or die "Can't open '$File.good' file \n";

  while (<INFILE>) {    
    @fields = split /\|/, $_;
    if ( $fields[0] <= $FooBar ) { 
      print OUTFILE $_;
Thank you.
Old 09-20-2006, 02:14 PM   #2
spirit receiver
Registered: May 2006
Location: Frankfurt, Germany
Distribution: SUSE 10.2
Posts: 424

Rep: Reputation: 33
You can use threads, see


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl loop jazman Programming 3 07-05-2006 11:31 AM
Perl: Where am I in a foreach loop? jrtayloriv Programming 3 01-30-2005 11:43 PM
loop through string with perl lfur Programming 2 07-03-2004 09:05 AM
Need help with perl loop! morbid_ru Programming 1 02-24-2004 02:14 PM
Need help with perl loop! morbid_ru Programming 2 02-17-2004 06:15 AM

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration