Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

passing paramaters to verify_child.pl

Quote Reply
passing paramaters to verify_child.pl
I'm trying to get the verify command to access a different table than Links. It is within verify-child.pl that I need to make this change, but I'm not sure how to pass a paramater to it from parallel.pm.


This is what I have done.

in nph-verify.cgi I'm trying to pass $table

my $checker = new Links::Parallel (
'max_workunit' => $max_workunit,
'min_workunit' => $min_workunit,
'spawn_delay' => $spawn_delay,
'max_children' => $max_children,
'child_path' => $LINKS{child_path},
'path_to_perl' => $LINKS{path_to_perl},
'on_response' => \&link_report,
'table' => $table,
'debug_level' => 1
);

in Parallel.pm I accept the input by doing this:

....
$self->{to_check} = defined ( $p{to_check} ) ? $p{to_check} : [];
$self->{on_response} = defined ( $p{on_response} ) ? $p{on_response} : \&do_nothing;
$self->{table} = defined ( $p{table} ) ? $p{table} : "Links";


Now, what do I do in verify-child.pl to make these following lines evaluate the the $table I'm trying to pass to it.

$SQLquery = "select ID,URL from $table where ID in (" . join (",", @ARGV ) . ")";
$db = new Links: BSQL "$LINKS{admin_root_path}/defs/$table.def";

I've gotten every other part of the verify process to work on a different table except this part. This is the one place in all these scripts, I can't figure out how to pass a parameter.

Any clues..

Kyle



[This message has been edited by klangan (edited January 18, 2000).]
Quote Reply
Re: passing paramaters to verify_child.pl In reply to
In Parallel.pm add:

$self->{child_args} = defined ( $p{table} ) ? $p{table} : "Links";

That will pass the table name as the first parameter to verify_child.pl. verify_child.pl isn't expecting this, so you need to modify it so that it pops the first argument off and assumes it's the table name.

Cheers,

Alex