sankoshy has asked for the wisdom of the Perl Monks concerning the following question:
*************** sub BuildLeaf { my ($hostname, $lo_add, $ospf_process, $ospf_area, $bgp_as, $bgp_p +ass, @VRF_names, @spines_ip) = @_; #$ do a whole bunch of stuff here ## } BuildLeaf ($leaf_info[0][[$i]],$leaf_info[[1]][[$i]],"Underlay",$ospf_ +area,$bgp_as,$bgp_MD5_pass,@{@vrf_info[0]},@{@spine_info[[1]]}); ***************
When I pass the arrays to the sub Buildleaf using arrays vrf_info and spine_info, for some reason array vrf_info gets populated with the vales from array spine_info and spine_info becomes empty. What gives ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pass Arrays to a subroutine
by davido (Cardinal) on Nov 27, 2015 at 04:15 UTC | |
|
Re: Pass Arrays to a subroutine
by Laurent_R (Canon) on Nov 27, 2015 at 07:20 UTC | |
|
Re: Pass Arrays to a subroutine
by neilwatson (Priest) on Nov 27, 2015 at 14:48 UTC | |
by stevieb (Canon) on Nov 27, 2015 at 15:00 UTC | |
|
Re: Pass Arrays to a subroutine
by AnomalousMonk (Archbishop) on Nov 27, 2015 at 17:36 UTC |