Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- remove a value from a callback array
- Mark D Smith
May 13, 2005, 9:18 pm
rate this thread
i have a call-back which i need to check 1 array value and remove some of
the words used.
my $status =$content->;
fine gives 1 or 0 which i use but
$content-> is an array of words some of which i want to delete.
my $names =$content->;
example $names = test1 test2 test3 wibble test4 in this instance i want to
Re: remove a value from a callback array
I don't see any call-backs in your code.
I assume you mean that $content-> is reference to an array of.....
Anyway, if want to delete words, it may make more sense for it to be
reference to a hash, rather than a reference to an array.
If you truly can't turn it into a hash, I guess I would do:
@} = grep $_ ne $word_to_delete, @};
or if you need to delete several words (stored in %words_to_delete):
@} = grep not exists $words_to_delete,
This looks like Perl, although I don't understand what you intend by it.
This looks like neither Perl nor English, but some incomprehensible mismash
of the two. I have no idea what you are trying to say about $names.
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB