I am writing a very simple sub-routine with one array and one scalar as the input. The problem is that i can't see the value of the scalar within the subroutine. Where am i going wrong?
my $name1="chrom1 unique"; print "NAME1 $name1\n"; cog_class(@c1_uniq_cog_ids, $name1); + + sub cog_class { + + my (@c1_uniq_cog_ids, $name) = @_; # DOESN'T WORK BELOW! print "NAME $name\n"; + + for (my $i=0; $i<@c1_uniq_cog_ids; $i++) { # BLAH BLAH } + + }
In reply to subroutine arguments by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |