Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Pass local array by reference?

by Coruscate (Sexton)
on Jan 21, 2003 at 21:30 UTC ( [id://228852]=note: print w/replies, xml ) Need Help??


in reply to Pass local array by reference?

Maybe something like the following can help you... Untested:

#!/usr/bin/perl -w use strict; sub foo { my $array = shift; print join(",", @{$array}), "\n"; } sub bar { my $array = shift; return reverse @{$array}; } my @array = ('foo', 'bar', 'qux'); my @bar = bar( \@array ); foo( \@bar );

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://228852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2025-06-22 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.