Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PBML] How to remove repetive value from array

Expand Messages
  • Oliver Manickum
    Hey Kasem, There are many ways.. one way i like is this @myarray = (1,2,3,3,4,2,9,2); foreach (@myarray) { $hasharray{$_} = $_; } this way u can only have one
    Message 1 of 2 , Aug 31, 2000
      RE: [PBML] How to remove repetive value from array

      Hey Kasem,

      There are many ways.. one way i like is this
              @myarray = (1,2,3,3,4,2,9,2);
              foreach (@myarray) {
                      $hasharray{$_} = $_;
              }

      this way u can only have one identical value... ;) u can put it back into the orig. array if u want..

      -
      Oliver Manickum
      ____________________________
      ePages Internet & Multimedia
      http://www.epages.net/
      Tel : +27 (0)31 2651281


      -----Original Message-----
      From: Kasem Boonmun [mailto:boonmun@...]
      Sent: Thursday, August 31, 2000 3:30 PM
      To: perl
      Subject: [PBML] How to remove repetive value from array


      -------------------------- eGroups Sponsor -------------------------~-~>
      Thousands of Great Jobs, One Great Location!
      Austinatwork.com. Great Jobs, Great Life!
      http://click.egroups.com/1/7847/15/_/12898/_/967728522/
      ---------------------------------------------------------------------_->

      Hi All,
          I spent a week to figure out how to remove a repetive value from my
      array but i didn't get through.
      For example,
      @myarray = (1,2,3,3,4,2,9,2,)
      I only need it to be @newarray =(1,2,3,4,9)
      Please give me a clue?
      TIA
      KB






    Your message has been successfully submitted and would be delivered to recipients shortly.