in reply to subroutine arguments
The problem here is the array @c1_uniq_cog_ids and the scalar variable $name1 have got flattened and will be stored in the variable @c1_uniq_cog_ids inside your subroutine. So inorder to retain the values you need to pass the array as reference.
cog_class(\@c1_uniq_cog_ids, $name1); sub cog_class { + my ($c1_uniq_cog_ids, $name) = @_; ### you can use @$c1_uniq_cog_ids to get the contents array }
In your case even you can reverse the way in which your parameters are passed.
cog_class($name1,@c1_uniq_cog_ids); sub cog_class { my ($name,@c1_uniq_cog_ids)=@_; }
Hope this may shed some light....
Regards,
Murugesan Kandasamy
use perl (;;);
|
|---|