start page | rating of books | rating of authors | reviews | copyrights

Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: Reference: clone Chapter 17
The LWP Library
Next: Reference: push_header
 

header

 $

h


->header
(

field

 [=> $

val

],...)

When called with just an HTTP header as a parameter, this method returns the current value for the header. For example, $myobject->('content-type') would return the value for the object's Content-Type header. To define a new header value, invoke header with a hash of header=>value pairs, where the value is a scalar or reference to an array. For example, to define the Content-Type header, you would do this:

$h->header('content-type' => 'text/plain');


Previous: Reference: clone Perl in a Nutshell Next: Reference: push_header
Reference: clone Book Index Reference: push_header