MonkPaul has asked for the wisdom of the Perl Monks concerning the following question:
Further to my recent node 474948 i have a question relating to flattened hashes and arrays.
When an array or hash is passed to a subroutine or function it is flattened and so if it is passed as (@, $) and recieved as (@, $) the $ will have no value.
Is this the same with passing to an external script using the exec function.
At the moment i am doing this:
exec = ("BlastTool.cgi", "$date", "$show_filter", "$oldRefFile", "$blast_filehandle", "$ref_filehandle", "$email", "$send_email","$show_all", "\@OrigRef", "\@blastLine", "\@species_filter", "\@chromo_filter", "\@advanced_filter") or die;
In script one, then passing to script 2
Is this right or am i way off here.my $date = shift @_; my $show_filter = shift @_; my $oldRefFile = shift @_; my $blast_filehandle = shift @_; my $ref_filehandle = shift @_; my $email = shift @_; my $send_email = shift @_; my $show_all = shift @_; my @OrigRef = @{shift @_}; my @blastLine = @{shift @_}; my @species_filter = @{shift @_}; my @chromo_filter = @{shift @_}; my @advanced_filter = @{shift @_};
I have also noticed that i have left out the @args at the end of the exec function: exec("program", "params", @args);
Does this matter.
cheers.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing and recieving params
by merlyn (Sage) on Jul 15, 2005 at 15:58 UTC | |
by jeffa (Bishop) on Jul 15, 2005 at 16:17 UTC | |
by MonkPaul (Friar) on Jul 15, 2005 at 16:28 UTC | |
by ikegami (Patriarch) on Jul 15, 2005 at 16:34 UTC | |
by MonkPaul (Friar) on Jul 15, 2005 at 16:42 UTC | |
by ikegami (Patriarch) on Jul 15, 2005 at 16:46 UTC | |
| |
|
Re: Passing and recieving params
by ikegami (Patriarch) on Jul 15, 2005 at 16:07 UTC | |
|
Re: Passing and recieving params
by socketdave (Curate) on Jul 15, 2005 at 16:09 UTC |