Thank you but it doesn't work...Maybe I'm doing something wrong :
#!/usr/bin/perl
use Parallel::ForkManager;
my $pm = new Parallel::ForkManager(3);
my @y;
{
open my $fh_y, '<', 'y' or die $!;
chomp( @y = <$fh_y> );
}
open(my $fh_x, '<', 'x') or die $!;
while (<$fh_x>) {
$pm->start and next;
chomp( my $linex = $_ );
open my $fh_out, '>', $linex or die $!;
for (@y) {
print $fh_out ("$linex$liney\n");
}
$pm->finish
}
When I perl script.pl it gives me the 5 "$filex" files but like this :
jacky@ubuntu:~/Desktop/test$ cat 1
1
1
1
So definatelly there is something wrong in there...Thank you again
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.