a2822c
diff --git a/magic/Magdir/perl b/magic/Magdir/perl
a2822c
index ef0cc6d..453665c 100644
a2822c
--- a/magic/Magdir/perl
a2822c
+++ b/magic/Magdir/perl
a2822c
@@ -5,24 +5,22 @@
a2822c
 # The `eval' lines recognizes an outrageously clever hack.
a2822c
 # Keith Waclena <keith@cerberus.uchicago.edu>
a2822c
 # Send additions to <perl5-porters@perl.org>
a2822c
-0	search/1/w	#!\ /bin/perl			Perl script text executable
a2822c
-!:mime	text/x-perl
a2822c
 0	search/1	eval\ "exec\ /bin/perl		Perl script text
a2822c
 !:mime	text/x-perl
a2822c
-0	search/1/w	#!\ /usr/bin/perl		Perl script text executable
a2822c
-!:mime	text/x-perl
a2822c
 0	search/1	eval\ "exec\ /usr/bin/perl	Perl script text
a2822c
 !:mime	text/x-perl
a2822c
-0	search/1/w	#!\ /usr/local/bin/perl		Perl script text executable
a2822c
-!:mime	text/x-perl
a2822c
 0	search/1	eval\ "exec\ /usr/local/bin/perl	Perl script text
a2822c
 !:mime	text/x-perl
a2822c
 0	search/1	eval\ '(exit\ $?0)'\ &&\ eval\ 'exec	Perl script text
a2822c
 !:mime	text/x-perl
a2822c
-0	search/1	#!/usr/bin/env\ perl	Perl script text executable
a2822c
-!:mime	text/x-perl
a2822c
-0	search/1	#!\ /usr/bin/env\ perl	Perl script text executable
a2822c
-!:mime	text/x-perl
a2822c
+
a2822c
+0   search/1    #!
a2822c
+>0  regex       \^#!.*/bin/perl.*$  Perl script text executable
a2822c
+!:mime  text/x-perl
a2822c
+>0  regex       \^#!.*/bin/env\ perl.*$  Perl script text executable
a2822c
+!:mime  text/x-perl
a2822c
+# to be tried before awk script
a2822c
+!:strength + 40
a2822c
 
a2822c
 # by Dmitry V. Levin and Alexey Tourbin
a2822c
 # check the first line