blib/lib/Apache/AxKit/StyleChooser/Hostname.pm

filter: Statementstmt 66.6% 4 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 75.0% 6 / 8 CC 1 SCAR 1.4
CC
1
Cov
67%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
↑ Summary
1 # $Id: Hostname.pm,v 1.3 2004/06/24 18:28:37 nachbaur Exp $
2  
3 package Apache::AxKit::StyleChooser::Hostname;
4  
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 0 ▶use Apache::Constants qw(OK);
Subroutine BEGIN: called CC=1 SCAR=2.6
7 our $VERSION = 0.01;
8  
9 sub handler {
10 my $r = shift;
11
12 my $style = $r->hostname();
13  
14 if ($style && $style ne $r->server->server_hostname()) {
15 $style =~ s/^www\.//; # trim off useless "www" prefix
16 $r->notes('preferred_style', $style);
17 }
18 return OK;
19 }
20  
21 1;
22 __END__
↑ Summary