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

Dear Monks
I am using Set::Object Module and I have some difficult time using insert, includes and remove methods. They simply don't work at all.

Any example would be helpful here.

Thanks
artist

Title edit by tye

  • Comment on Problem using Set::Object's insert(), includes(), and remove() methods

Replies are listed 'Best First'.
Re: Set::Object
by pfaut (Priest) on Jan 14, 2003 at 02:24 UTC

    It would help to see some code.

    Did you follow all of the installation instructions or did you just copy files into your perl lib directories?

    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
      I got it working.
      It would be interesting to know the error I made
      Perldoc said:

      remove([list]) Remove objects from a Set::Object. Removing the same object more than once, or removing an object absent from the Set::Object is not an error. Returns the number of elements that were actually removed.

      So I try to use the method

      remove($array_ref)

      Actually what required was
      remove(@array_or_list)

      artist