Setting content type.

Should content_type be able to take a list?

use HTTP::Headers;
use Data::Dumper;

my $h1 = HTTP::Headers->new;
my $h2 = HTTP::Headers->new;

$h1->content_type('text/html; charset=uft8');
print $h1->as_string;


$h2->content_type( $h1->content_type );
print $h2->as_string;

my [at] ct = $h1->content_type;
print Dumper \ [at] ct;

$h2->content_type( [at] ct );
print $h2->as_string;


Generates:

Content-Type: text/html; charset=uft8
Content-Type: text/html
$VAR1 = [
'text/html',
'charset=uft8'
];
Content-Type: text/html



--
Bill Moseley
moseley [at] hank.org
moseley [ Di, 24 Januar 2006 21:49 ] [ ID #1157091 ]

Re: Setting content type.

Bill Moseley <moseley [at] hank.org> writes:

> Should content_type be able to take a list?

Seems like a good idea to me.

--Gisle
gisle [ Mi, 25 Januar 2006 10:51 ] [ ID #1158928 ]
Perl » perl.libwww » Setting content type.

Vorheriges Thema: URI.pm error
Nächstes Thema: Module HTML::HeadParser Problem