Help for this page

Select Code to Download


  1. or download this
        return $ct{'text/plain'} if exists $ct{'text/plain'};
        return $ct{'text/html'} if exists $ct{'text/html'};
        return $parts[0] if $which =~ /text/; 
        return $parts[1] if $which =~ /html/;
    
  2. or download this
        my $ct = $which eq 'html' ? 'text/html' : 'text/plain';
        return $ct{$ct} if exists $ct{$ct};
    ...
    
        # Fall back to whatever's first
        return $parts[0];
    
  3. or download this
    $ct{$_->content_type} = $_ for @parts;
    
  4. or download this
    $ct{$_->content_type} ||= $_ for @parts;