in reply to delete array of hashes

@array = ();

or

$#array = -1;

will empty your array. Or you could just assign another list to the array and skip the emptying step.

@array = ($newhashref1, $newhashref2);

Replies are listed 'Best First'.
Re^2: delete array of hashes
by popsin (Initiate) on Sep 16, 2004 at 16:14 UTC
    Yes but...
    eg. Array had 3 elements (hashes).
    Then I delete the array.
    Then I continue pushing new elements in the array (push(@arr,{});) but it seems that the first 3 places are still occupated and my new hashes start populating positions 4, 5, ... in the array.
    Any ideas?

      I don't think that can be true if you empty the array as you have been shown above. Perhaps you can show us the relevant parts of your code.

      --
      <http://www.dave.org.uk>

      "The first rule of Perl club is you do not talk about Perl club."
      -- Chip Salzenberg

        Well, I probably have a problem with variable definitions.
        When I put "use strict" the program doesn't work so I had to comment that line...

        See you later when I figure it out myself.