[svk-commit] r2427 - trunk/lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Tue Jul 10 20:33:22 EDT 2007


Author: audreyt
Date: Tue Jul 10 20:33:21 2007
New Revision: 2427

Modified:
   trunk/lib/SVK/Util.pm

Log:
* SVK::Util: Perl 5.9.5 doesn't like "my $mm if 0", so change
  to the more acceptable outer-my style.

Modified: trunk/lib/SVK/Util.pm
==============================================================================
--- trunk/lib/SVK/Util.pm	(original)
+++ trunk/lib/SVK/Util.pm	Tue Jul 10 20:33:21 2007
@@ -476,23 +476,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