1 package URI::mailto; # RFC 2368
5 @ISA=qw(URI URI::_query);
12 my @old = $self->headers;
15 # get rid of any other to: fields
16 for (my $i = 0; $i < @new; $i += 2) {
17 if (lc($new[$i]) eq "to") {
24 $to = "" unless defined $to;
25 unshift(@new, "to" => $to);
28 return unless defined wantarray;
34 push(@to, $v) if lc($h) eq "to";
44 # The trick is to just treat everything as the query string...
45 my $opaque = "to=" . $self->opaque;
51 # strip out any "to" fields
53 for (my $i=0; $i < @new; $i += 2) {
54 if (lc($new[$i]) eq "to") {
55 push(@to, (splice(@new, $i, 2))[1]); # remove header
60 my $new = join(",",@to);
64 $self->query_form(@new) if @new;
66 return unless defined wantarray;
69 URI->new("mailto:?$opaque")->query_form;