From d16b2e5239f51485e63e27b1b8700611377e0d9f Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Thu, 31 Jul 2008 23:57:38 +0000 Subject: [PATCH] prefer single quotes in perl code Following Perl Best Practices: use single quotes (q//) if no interpretation is expected. --- index.plp | 72 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/index.plp b/index.plp index 592d5d5..602eefc 100644 --- a/index.plp +++ b/index.plp @@ -2,22 +2,22 @@ use utf8; use strict; use warnings; -no warnings "qw"; # you know what you doing -no warnings "uninitialized"; # save some useless checks for more legible code +no warnings 'qw'; # you know what you doing +no warnings 'uninitialized'; # save some useless checks for more legible code -our $VERSION = "1.1"; +our $VERSION = '1.1'; our $ascii = 0; if (exists $get{ascii}) { - $ascii = $get{ascii} ne "0"; # manual override + $ascii = $get{ascii} ne '0'; # manual override } elsif (defined $ENV{HTTP_ACCEPT_CHARSET}) { $ascii = 1; - for (split ",", $ENV{HTTP_ACCEPT_CHARSET}) { - $ascii = 0, last if $_ eq "*" or m/utf-?8/i; + for (split q{,}, $ENV{HTTP_ACCEPT_CHARSET}) { + $ascii = 0, last if $_ eq '*' or m{utf-?8}i; } } -my $charset = $ascii ? "us-ascii" : "utf-8"; +my $charset = $ascii ? 'us-ascii' : 'utf-8'; my $ctype = "text/html; charset=$charset"; $header{content_type} = $ctype; @@ -32,15 +32,15 @@ $header{content_type} = $ctype; <: my %styles = map {$_ => $_} qw(dark circus mono terse); - our $style = exists $get{style} && $styles{$get{style}} || "light"; + our $style = exists $get{style} && $styles{$get{style}} || 'light'; printf(qq{\n}, - $_ eq $style ? "stylesheet" : "alternate stylesheet", "$_.css", $_ + $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "$_.css", $_ ) for keys %styles; - our $showkeys = exists $get{keys} && $get{keys} ne "0"; + our $showkeys = exists $get{keys} && $get{keys} ne '0'; print "\n" unless $showkeys; print "\n" - if $showkeys and $get{keys} eq "ghost"; + if $showkeys and $get{keys} eq 'ghost'; :>