Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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 } + + }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: subroutine arguments
by mulander (Monk) on Oct 25, 2005 at 11:14 UTC | |
|
Re: subroutine arguments
by McDarren (Abbot) on Oct 25, 2005 at 11:22 UTC | |
by cbrandtbuffalo (Deacon) on Oct 25, 2005 at 12:22 UTC | |
by revdiablo (Prior) on Oct 25, 2005 at 14:11 UTC | |
|
Re: subroutine arguments
by blazar (Canon) on Oct 25, 2005 at 11:12 UTC | |
|
Re: subroutine arguments
by murugu (Curate) on Oct 25, 2005 at 12:13 UTC |