Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
This gives the error "Type of arg 1 to shift must be array (not list)..." how do we pass such a list to a function? Thanks for the help@reduced_protein = shift (\@reduced_protein,($x2-$x1),($y2-$y1),($z2-$ +z1)); # reduced protein is 2D array with each line having some properties ab +out the protein. The shift function just shifts the coordinates of th +e all lines thus the protein (given below) sub shift { my ($reduced_protein, $shift_x, $shift_y, $shift_z); my @reduced_protein=@$reduced_protein; my $index1; my $protein_length=findColumnLength(@reduced_protein); for ... (shifting operation) return @reduced_protein; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing Lists to Functions?
by RMGir (Prior) on May 16, 2008 at 22:48 UTC | |
|
Re: Passing Lists to Functions?
by johngg (Canon) on May 16, 2008 at 22:57 UTC | |
|
Re: Passing Lists to Functions?
by pc88mxer (Vicar) on May 16, 2008 at 22:49 UTC | |
|
Re: Passing Lists to Functions?
by mwah (Hermit) on May 17, 2008 at 12:14 UTC |