Parse-MIME

 view release on metacpan or  search on metacpan

lib/Parse/MIME.pm  view on Meta::CPAN

	my ( $mime_type ) = @_;

	my @part      = split /;/, $mime_type;
	my $full_type = _strip shift @part;
	my %param     = map { _strip split /=/, $_, 2 } @part;

	# Java URLConnection class sends an Accept header that includes a single "*"
	# Turn it into a legal wildcard.
	$full_type = '*/*' if $full_type eq '*';

	my ( $type, $subtype ) = _strip split m!/!, $full_type;

	return ( $type, $subtype, \%param );
}

sub parse_media_range {
	my ( $range ) = @_;

	my ( $type, $subtype, $param ) = parse_mime_type $range;

	$param->{'q'} = 1



( run in 0.609 second using v1.01-cache-2.11-cpan-71847e10f99 )