RE: Best way to pass arguments to an Apache2::SubProcess?

"Ihnen, David" <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <0C4F9AE61E425F4F8C6912AF90E9A9E9C6F2C4C2@EX-SEA19-B.ant.amazon.com>
Environment variables have size limits - you should pass it as the args reference because of that, and the fact that you're sending a pointer rather than the whole data helps too, though the system is probably copying it somewhere in there you shouldn't have to worry about it.

The point they're inferring in the examples is that the second element is a list reference - not whether it's a referenced to a named list or not is irrelevant.

David

-----Original Message-----
From: Tosh Cooey [mailto:[email protected]] 
Sent: Tuesday, February 02, 2010 5:06 PM
To: [email protected]
Subject: Best way to pass arguments to an Apache2::SubProcess?

So my will has crumbled, mostly because I'm probably not very good at 
the "resident in memory" part of mod_perl and I will be using 
Apache2::SubProcess to fire off a sub-process.

There seems to be two easy ways to send data to my detached sub-process; 
via an \@args or via $r->subprocess_env->set.

I would like to pass large data structures which I will JSON encode and 
I'm wondering which of the above would be best for that, if any, and 
what the limitations are of either.

Also, I was wondering, in the docs for Apache2::SubProcess in the 
section about properly detaching the sub-process it has in the example:

$r->spawn_proc_prog ('/path/to/detach_script.pl', $args);

Is there a reason $args is used rather than \@args as outlined earlier 
in the docs?

opt arg2: \@argv ( ARRAY ref )

Or is it possible to create an $args->[0..10] and pass that?

Thanks!

Tosh
-- 
McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.