in reply to Re^3: Is there a better way to check if an array is empty?
in thread Is there a better way to check if an array is empty?

To say in short again,I am searching for a new file in the keys of a hash and pushing the grep results to an array,if the array is emtpy then only push the new file to another array "@newfiles" and then come out of the loop(that's the reason I added a next)

  • Comment on Re^4: Is there a better way to check if an array is empty?

Replies are listed 'Best First'.
Re^5: Is there a better way to check if an array is empty?
by GrandFather (Saint) on Dec 21, 2010 at 20:24 UTC

    Your code has no loop! Maybe you need to show a little more of the code? It would be even better to mock up some data and show the result you expect compared with the result you are getting - at present it's not clear because your code doesn't match your comments.

    True laziness is hard work
Re^5: Is there a better way to check if an array is empty?
by JavaFan (Canon) on Dec 21, 2010 at 20:35 UTC
    and then come out of the loop
    One way of improving your code is to create a loop. Without a loop, you can't come out of it.