Text::Header

RFC 822/2068 header and unheader functions
Download

Text::Header Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Nate Wiger
  • Publisher web site:
  • http://search.cpan.org/~nwiger/

Text::Header Tags


Text::Header Description

RFC 822/2068 header and unheader functions Text::Header is a Perl module that provides two new functions, header and unheader, which provide general-purpose RFC 822 header construction and parsing. They do not provide any intelligent defaults of HTTP-specific methods. They are simply aimed at providing an easy means to address the mechanics of header parsing.The output style is designed to mimic CGI.pm and HTTP::Headers, so that users familiar with these interfaces will feel at home with these functions. As shown above, the headers function automatically does the following:1. uc's the first letter of each tag token and lc's the rest, also converting _'s to -'s automatically2. Adds a colon separating each tag and its value, and exactly one newline after each one3. Combines list elements into a comma-delimited stringSYNOPSIS use Text::Header; # header and unheader exported # Construct headers similar to CGI.pm and HTTP::Headers @HEADERS = header(content_type => 'text/html', author => 'Nathan Wiger', last_modified => $date, accept => ); # The above produces the array: @HEADERS = ("Content-Type: text/html ", "Author: Nathan Wiger ", "Last-Modified: Wed Sep 27 13:31:06 PDT 2000 ", "Accept: text/html, text/plain "); # Can also construct SMTP headers to format mail @mail_headers = header(from => 'Nathan Wiger ', to => 'perl5-porters@perl.org'); print $MAIL @mail_headers, " Keep up the great work! "; # The above would print this to the $MAIL handle: From: Nathan Wiger < nate AT sun.com > To: perl5-porters AT perl.org Keep up the great work! Requirements: · Perl


Text::Header Related Software