Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Passing array to a subroutine

by 1nickt (Prior)
on Sep 13, 2017 at 13:44 UTC ( #1199303=note: print w/replies, xml ) Need Help??

in reply to Passing array to a subroutine

Pass a reference to the array instead:

$t->sadk_flap_mx_ifd_laser( ifd => \@child_interfaces, flap => $flaps +);
Then dereference it in the subroutine:
sub sadk_flap_mx_ifd_laser { my %args = @_; my @child_interfaces = @{ $args{'ifd'} }; my $flap = $args{'flap'}; ... }

Hope this helps!

Update: removed unrelated link to perldsc, the correct doc is perlreftut as pointed out below by haukex.

The way forward always starts with a minimal test.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1199303]
[marto]: :)
[ambrus]: robby: dunno, I would like to visit London some time, although there are other places I'd like to visit more
[marto]: "Okay, sure, there are in fact museums and art galleries and other culturally enlightened things to do in Glasgow, but that wouldn't have made a funny comic"
LanX .oO( cemetery breweries ? )

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-12-15 11:09 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (431 votes). Check out past polls.