Blair Zajac <[EMAIL PROTECTED]> writes:

> Looks like we have different usage.  I don't care about the header values,
> just the header's that existed and were removed.  So this is what I currently
> do:
>       foreach my $remove_header (@abc) {
>         next unless defined $header->header($remove_header);
>         $header->remove_header($remote_header);
>         print "Removed $remove_header\n";
>       }
> So in my case, having something where remove_header returns the headers
> removed would allow me to do this:
>       print join(',', $header->remove_header(@abc));
> and print a comma separated list of the removed headers.

Ok.  That is kind of cool.

> However, your usage where remove_header returns the value instread of the
> header name, what do you do if it gets called with multiple headers to remove?

It would do the same thing, but you would not be able to tell what
values belongs to which header names.  I agree that is unfortunate.

> How are the values from separate headers distinguished?  A list of array
> references?

That is too ugly I think.  If people need to distinguish then they
could call it with one name at a time.

> Your usage would still allow me to do a simple test:
>       foreach my $remove_header (@abc) {
>         if ($header->remove_header($remote_header)) {
>           print "Removed $remove_header\n";
>         }

Since the header value might be "0" or "" you should probably write
this as:

          if (defined($header->remove_header($remote_header))) {
            print "Removed $remove_header\n";

If we made it return the number of headers removed in scalar context
then you would not need to do this.

>       }


Reply via email to