* Package name : libfork-perl
Version : 1.0.0
Upstream Author : Sebastien J. Gross <w...@chezwam.org>
* URL : none
* License : GPL
Description : A fork(2) wraper for Perl
Fork makes fork development easier.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux shiva 2.4.18 #1 Mon Jul 22 10:53:53 CEST 2002 i686
Locale: LANG=C, LC_CTYPE=C
-- no debconf information
--
To UNSUBSCRIBE, email to debian-dev...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Great! Just what I've been waiting for. I am forever saved the tedious,
yet difficult task of writing
pid = fork;
in my perl code. It's now easily replaced with the simple and much easier
to understand
use forkwrapper;
pid = forkwrapper.fork;
Uh, wait, no, now that I think about, it, the new way is not that much
clearer and easier. Hmmm. Perhaps I'm not understanding the benefits of
libfork-perl. Maybe if there was a place in the package description to
summarize what features libfork-perl provides, and how it makes fork
development[1] easier.
Hint, Hint.
Also, 'wraper' is more commonly spelled 'wrapper'.
Regards,
Steve
[1] Actually, I've always thought the fork to be a pretty well developed
utensil. The spoon, now, *that* needs some work. And don't even get me
started on the spatula.
--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net
> Uh, wait, no, now that I think about, it, the new way is not that much
> clearer and easier. Hmmm. Perhaps I'm not understanding the benefits of
> libfork-perl. Maybe if there was a place in the package description to
> summarize what features libfork-perl provides, and how it makes fork
> development[1] easier.
Well it was origninaly designed to run function many times in parallel
in background an get its return value.
imagine this small script:
sub b($) {
return "<$_[0]>";
}
sub test_fork($) {
my $args = shift;
sleep $args->[2];
return [$args->[0], b $args->[1]];
}
my $data = [
# ID, data, sleep...
[1 ,"Item 1", 1],
[2 ,"Item 6", 6],
[3 ,"Item 2", 2],
[4 ,"Item 5", 3],
[5 ,"Item 3", 5],
[6 ,"Item 4", 4],
];
my $values = fork_it {
fct => \&test_fork,
args => $data,
max_children => 6,
timeout => 10,
};
my $sorted_values = [ sort { $a->[0] cmp $b->[0] } (@$values) ];
print Dumper $sorted_values;
will return
$VAR1 = [
[
1,
'<Item 1>'
],
[
2,
'<Item 6>'
],
[
3,
'<Item 2>'
],
[
4,
'<Item 5>'
],
[
5,
'<Item 3>'
],
[
6,
'<Item 4>'
]
];
--
Sebastien J. Gross | Debian GNU/Linux
s...@debian.org | http://www.debian.org
GPG: 1024g/AF0DDC9A AB35 1FFB 1268 56C0 452B 302E 2A25 8421 53BB A490
On 31-Oct-02, 14:05 (CST), "Sebastien J. Gross" <s...@debian.org> wrote:
> Steve Greenland <ste...@moregruel.net> writes:
>
> > Uh, wait, no, now that I think about, it, the new way is not that much
> > clearer and easier. Hmmm. Perhaps I'm not understanding the benefits of
> > libfork-perl. Maybe if there was a place in the package description to
> > summarize what features libfork-perl provides, and how it makes fork
> > development[1] easier.
>
> Well it was origninaly designed to run function many times in parallel
> in background an get its return value.
I'm afraid you missed my point (my fault for trying to be funny):
Your proposed description field is useless. Please write something that
tells the prospective user why they might want to install/use it. Maybe
this was clear, but I didn't get that feeling from your response. Something
like
Description: run perl functions in parallel
A function to start several copies of a perl function with different
arguments and collect the return values.
Steve
--
Steve Greenland
The irony is that Bill Gates claims to be making a stable operating
system and Linus Torvalds claims to be trying to take over the
world. -- seen on the net