home *** CD-ROM | disk | FTP | other *** search
/ CLIX - Fazer Clix Custa Nix / CLIX-CD.cdr / mac / lib / auto / URI / URL / http / keywords.al < prev    next >
Text File  |  1997-06-23  |  739b  |  24 lines

  1. # NOTE: Derived from ./blib/lib/URI/URL/http.pm.  Changes made here will be lost.
  2. package URI::URL::http;
  3.  
  4. # Note that the following two methods does not return the old
  5. # value if they are used to set a new value.
  6. # The risk of croaking is to high :-)  We will eventually rely
  7. # on undefined wantarray (require perl5.004).
  8.  
  9. # Handle ...?dog+bones type of query
  10. sub keywords {
  11.     my $self = shift;
  12.     $old = $self->{'query'};
  13.     if (@_) {
  14.     # Try to set query string
  15.     $self->equery(join('+', map { URI::Escape::uri_escape($_, $URI::URL::reserved) } @_));
  16.     return undef;
  17.     }
  18.     return undef unless defined $old;
  19.     Carp::croak("Query is not keywords") if $old =~ /=/;
  20.     map { URI::Escape::uri_unescape($_) } split(/\+/, $old);
  21. }
  22.  
  23. 1;
  24.