Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: subroutines and returning lists...

by MrYoya (Monk)
on Apr 03, 2003 at 22:39 UTC ( [id://247914]=note: print w/replies, xml ) Need Help??


in reply to subroutines and returning lists...

Your first example, with
@returned_files = match_files(\@array, \%hash);
looks like it should work.

Also, to dereference an array reference, try @$returned_files

Compare these examples. The first returns a reference to an array:

#!/usr/bin/perl -w use strict; sub ret_array { my @array = qw( 1 2 3 4 5 ); return \@array; } my $returned_array = ret_array(); print @$returned_array;

And this returns an array
#!/usr/bin/perl -w use strict; sub ret_array { my @array = qw( 1 2 3 4 5 ); return @array; } my @returned_array = ret_array(); print @returned_array;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-25 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found