Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have an array that has 10 elements. I want to be able to group all the same elements together and place them into separate csv files. My questions is how do I separate the elements. I am at a loss and I have tried about everything. The array pulls from a query. the array will look like this {apple banana pear fruit} {aa bb cc fruit} {greens celery turnips vegetables} {xx yy zz vegetables} I want the fruit to be sparated into one file and the vegetables in another. Your assistance is greatly appreciated
  • Comment on compare element of an array to last array

Replies are listed 'Best First'.
Re: compare element of an array to last array
by naikonta (Curate) on Apr 20, 2007 at 16:12 UTC
    So you tried about everything. Could you show us just one of them? The code you tried I mean. Hopefully we can go further from that. And what do you mean by the same elements?

    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

      I have also tried a foreach and while statement and pop the last element but zI need it to compare the pop element to the next line in the array
    A reply falls below the community's threshold of quality. You may see it by logging in.