[svk-commit] r2487 - branches/2.0-releng/lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Tue Jul 17 11:34:25 EDT 2007


Author: clkao
Date: Tue Jul 17 11:34:25 2007
New Revision: 2487

Modified:
   branches/2.0-releng/lib/SVK/Util.pm

Log:
merge from trunk:
 r2427 at trunk:  audreyt | 2007-07-11 01:33:21 +0100
 * SVK::Util: Perl 5.9.5 doesn't like "my $mm if 0", so change
   to the more acceptable outer-my style.


Modified: branches/2.0-releng/lib/SVK/Util.pm
==============================================================================
--- branches/2.0-releng/lib/SVK/Util.pm	(original)
+++ branches/2.0-releng/lib/SVK/Util.pm	Tue Jul 17 11:34:25 2007
@@ -468,23 +468,26 @@
 
 =cut
 
+{ my $mm; # C<state $mm>, yuck
+
 sub mimetype {
     my ($filename) = @_;
-    my $mm if 0;  # C<state $mm>, yuck
 
     # find an implementation module if necessary
-    if ( !$mm ) {
+    $mm ||= do {
         my $module = $ENV{SVKMIME} || 'Internal';
         $module =~ s/:://;
         $module = "SVK::MimeDetect::$module";
         eval "require $module";
         die $@ if $@;
-        $mm = $module->new();
-    }
+        $module->new();
+    };
 
     return $mm->checktype_filename($filename);
 }
 
+}
+
 =head3 mimetype_is_text ($mimetype)
 
 Return whether a MIME type string looks like a text file.


More information about the svk-commit mailing list