Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi I am a new user in perl. My question is just how can change local array to global array in order to use in main program? for exapmle this is just part of my script:
my @species = split "//", $list; foreach my $species(@species) { my @tree = edit($species); print @tree; } sub edit { my ($species) = @_; if($species =~ /RANK *: subspecies/ && $species =~ /PARENT ID * : +(\d+)/) { my $pid = $1; # # print "$pid\n"; return `getz "[taxonomy:$pid]" -e`; } }
how can use @tree in main program? Thanks in advance tom
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: local and global variable?
by davido (Cardinal) on Aug 22, 2011 at 08:41 UTC | |
|
Re: local and global variable?
by Marshall (Canon) on Aug 22, 2011 at 09:11 UTC | |
by AnomalousMonk (Archbishop) on Aug 22, 2011 at 11:23 UTC | |
by Marshall (Canon) on Aug 22, 2011 at 13:29 UTC | |
by Jim (Curate) on Aug 22, 2011 at 17:36 UTC | |
|
Re: local and global variable?
by ricDeez (Scribe) on Aug 22, 2011 at 18:02 UTC |