dougm 00/04/13 21:09:26
Modified: . Makefile.PL
lib/Apache Build.pm
lib/ModPerl Code.pm
Log:
sticking to the convention of single quoting constant strings
Revision Changes Path
1.2 +6 -6 modperl-2.0/Makefile.PL
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.PL 2000/04/13 07:03:35 1.1
+++ Makefile.PL 2000/04/14 04:09:25 1.2
@@ -94,15 +94,15 @@
}
sub set_modperl_version {
- require "./lib/mod_perl.pm";
+ require './lib/mod_perl.pm';
$VERSION = $mod_perl::VERSION;
$VERSION =~ s/(\d\d)(\d\d)$/$1_$2/;
- open my $fh, "Changes";
+ open my $fh, 'Changes';
while(<$fh>) {
if(/^=item.*-dev/) {
- $VERSION .= "-dev";
+ $VERSION .= '-dev';
last;
}
last if /^=item/;
@@ -112,7 +112,7 @@
sub phat_warn {
my($msg, $abort) = @_;
- my $level = $abort ? "ERROR" : "WARNING";
+ my $level = $abort ? 'ERROR' : 'WARNING';
warn <<EOF;
************* $level *************
@@ -156,9 +156,9 @@
my $maybe = $build->find_dlfile_maybe('gdbm');
my $suggest = @$maybe ?
"You could just symlink it to $maybe->[0]" :
- "You might need to install Perl from source";
+ 'You might need to install Perl from source';
phat_warn(<<EOF);
-Your Perl is configured to link against libgdbm,
+Your Perl is configured to link against libgdbm,
but libgdbm.so was not found.
$suggest
EOF
1.2 +25 -25 modperl-2.0/lib/Apache/Build.pm
Index: Build.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Build.pm 2000/04/13 07:03:36 1.1
+++ Build.pm 2000/04/14 04:09:25 1.2
@@ -5,7 +5,7 @@
use warnings;
use Config;
use Cwd ();
-use constant is_win32 => $^O eq "MSWin32";
+use constant is_win32 => $^O eq 'MSWin32';
use constant IS_MOD_PERL_BUILD => grep { -e "$_/lib/mod_perl.pm" } qw(. ..);
our $VERSION = '0.01';
@@ -26,8 +26,8 @@
#these extra tries are for things built outside of mod_perl
#e.g. libapreq
push @trys,
- which("apxs"),
- "/usr/local/apache/bin/apxs";
+ which('apxs'),
+ '/usr/local/apache/bin/apxs';
}
for (@trys) {
@@ -36,13 +36,13 @@
last if -x $apxs;
}
- return "" unless $apxs and -x $apxs;
+ return '' unless $apxs and -x $apxs;
qx($apxs @_ 2>/dev/null);
}
sub apxs_cflags {
- my $cflags = __PACKAGE__->apxs("-q" => 'CFLAGS');
+ my $cflags = __PACKAGE__->apxs('-q' => 'CFLAGS');
$cflags =~ s/\"/\\\"/g;
$cflags;
}
@@ -55,7 +55,7 @@
return $app if -x $app;
}
- return "";
+ return '';
}
#--- Perl Config stuff ---
@@ -63,7 +63,7 @@
sub perl_config {
my($self, $key) = @_;
- return $Config{$key} ? $Config{$key} : "";
+ return $Config{$key} ? $Config{$key} : '';
}
@@ -86,7 +86,7 @@
sub find_dlfile {
my($self, $name) = @_;
- return "" unless $Config{'libs'} =~ /$name/;
+ return '' unless $Config{'libs'} =~ /$name/;
require DynaLoader;
require AutoLoader; #eek
@@ -139,7 +139,7 @@
sub build_config {
my $self = shift;
- unshift @INC, "lib";
+ unshift @INC, 'lib';
eval { require Apache::BuildConfig; };
shift @INC;
return bless {}, (ref($self) || $self) if $@;
@@ -260,7 +260,7 @@
$self->default_dir,
<../apache*/src>,
<../stronghold*/src>,
- "../src", "./src")
+ '../src', './src')
{
next unless (-d $src_dir || -l $src_dir);
next if $seen{$src_dir}++;
@@ -282,7 +282,7 @@
return $self->{ap_includedir} = "$d/include";
}
- $self->{ap_includedir} = Apache::Build->apxs("-q" => 'INCLUDEDIR');
+ $self->{ap_includedir} = Apache::Build->apxs('-q' => 'INCLUDEDIR');
}
#--- parsing apache *.h files ---
@@ -334,7 +334,7 @@
return 0 unless $fh;
my $n;
- my $mmn_pat = join "|", qw(MODULE_MAGIC_NUMBER_MAJOR MODULE_MAGIC_NUMBER);
+ my $mmn_pat = join '|', qw(MODULE_MAGIC_NUMBER_MAJOR MODULE_MAGIC_NUMBER);
while(<$fh>) {
if(s/^\#define\s+($mmn_pat)\s+(\d+).*/$2/) {
chomp($n = $_);
@@ -349,7 +349,7 @@
sub fold_dots {
my $v = shift;
$v =~ s/\.//g;
- $v .= "0" if length $v < 3;
+ $v .= '0' if length $v < 3;
$v;
}
@@ -361,7 +361,7 @@
sub httpd_version_cache {
my($self, $dir, $v) = @_;
- return "" unless $dir;
+ return '' unless $dir;
$self->{httpd_version}->{$dir} = $v if $v;
$self->{httpd_version}->{$dir};
}
@@ -393,7 +393,7 @@
next unless ($fserver,$fversion,$frest) =
m,^([^/]+)/(\d\.\d+\.?\d*)([^ ]*),i;
- if($fserver eq "Apache") {
+ if($fserver eq 'Apache') {
($server, $version) = ($fserver, $fversion);
#$frest =~ s/^(a|b)(\d+).*/'_' . (length($2) > 1 ? $2 : "0$2")/e;
$version .= $frest if $frest;
@@ -411,11 +411,11 @@
my $self = shift;
my @ldflags = ();
- if ($^O eq "aix") {
- if (my $file = find_in_inc("mod_perl.exp")) {
- push @ldflags, "-bI:" . $file;
+ if ($^O eq 'aix') {
+ if (my $file = find_in_inc('mod_perl.exp')) {
+ push @ldflags, '-bI:' . $file;
}
- my $httpdexp = $self->apxs("-q" => 'LIBEXECDIR') . "/httpd.exp";
+ my $httpdexp = $self->apxs('-q' => 'LIBEXECDIR') . '/httpd.exp';
push @ldflags, "-bI:$httpdexp" if -e $httpdexp;
}
return join(' ', @ldflags);
@@ -424,12 +424,12 @@
sub typemaps {
my $typemaps = [];
- if (my $file = find_in_inc("typemap")) {
+ if (my $file = find_in_inc('typemap')) {
push @$typemaps, $file;
}
if(IS_MOD_PERL_BUILD) {
- push @$typemaps, "../Apache/typemap";
+ push @$typemaps, '../Apache/typemap';
}
return $typemaps;
@@ -438,7 +438,7 @@
sub inc {
my $self = shift;
my $src = $self->dir;
- my $os = is_win32 ? "win32" : "unix";
+ my $os = is_win32 ? 'win32' : 'unix';
my @inc = ();
for ("$src/modules/perl", "$src/include",
@@ -450,11 +450,11 @@
my $ssl_dir = "$src/../ssl/include";
unless (-d $ssl_dir) {
my $build = $self->build_config;
- $ssl_dir = join '/', $self->SSL_BASE || "", "include";
+ $ssl_dir = join '/', $self->SSL_BASE || '', 'include';
}
push @inc, "-I$ssl_dir" if -d $ssl_dir;
- my $ainc = $self->apxs("-q" => 'INCLUDEDIR');
+ my $ainc = $self->apxs('-q' => 'INCLUDEDIR');
push @inc, "-I$ainc" if -d $ainc;
return "@inc";
@@ -463,7 +463,7 @@
sub ccflags {
my $self = shift;
my $cflags = $Config{'ccflags'};
- join " ", $cflags, $self->apxs("-q" => 'CFLAGS');
+ join ' ', $cflags, $self->apxs('-q' => 'CFLAGS');
}
sub define {
1.2 +2 -2 modperl-2.0/lib/ModPerl/Code.pm
Index: Code.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Code.pm 2000/04/13 07:03:37 1.1
+++ Code.pm 2000/04/14 04:09:26 1.2
@@ -78,7 +78,7 @@
hook_proto => \%hook_proto,
directive_proto => \%directive_proto,
flags => \%flags,
- path => "src/modules/perl",
+ path => 'src/modules/perl',
}, $class;
}
@@ -91,7 +91,7 @@
my $i = 0;
my $n = @$handlers;
- print $h_fh "\n#define ",
+ print $h_fh "\n", '#define ',
canon_define($class, 'num_handlers'), " $n\n\n";
for my $name (@$handlers) {