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

Re: passing arrays

by grep (Monsignor)
on Apr 19, 2008 at 17:38 UTC ( #681676=note: print w/ replies, xml ) Need Help??


in reply to passing arrays

You aren't passing anything into the sub csv

my @array = ( 1, 2, 3, 4, 5 ); csv( @array ); # pass array into csv sub csv { my @passed_array = @_; # reteive array from @_ foreach (@array) { print "$_\n"; } }
Check out perlsub

Also:
Please reduce your question to the smallest example of your problem. This not only saves us from having to dig through irrelevant code to find your real problem, but a good portion of the time you'll answer it yourself.

Update: added Also section

grep
One dead unjugged rabbit fish later...


Comment on Re: passing arrays
Select or Download Code
Re^2: passing arrays
by ScOut3R (Sexton) on Apr 19, 2008 at 17:40 UTC
    I know grep! :) I'm passing the the $in variable to readlog() from csv() and returning the @mails array from it.
    while (my $in = @data) { my @mails = readlog($in);
    But i think nothing is coming back.
      Ahhhh... this is why you should reduce your code to the problem. I did not see that buried in the rest of your code.

      you want a foreach

      foreach my $in (@data) { my @mails = readlog($in);
      grep
      One dead unjugged rabbit fish later...
        You're absolutely right. Now the values are passing back, but i have a new problem to sort out. :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (18)
As of 2015-07-06 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (83 votes), past polls