xref: /minix3/external/bsd/file/dist/magic/magdir/perl (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ef01931fSBen Gras#------------------------------------------------------------------------------
2*0a6a1f1dSLionel Sambuc# $File: perl,v 1.22 2014/04/28 12:04:35 christos Exp $
3ef01931fSBen Gras# perl:  file(1) magic for Larry Wall's perl language.
4ef01931fSBen Gras#
5ef01931fSBen Gras# The `eval' lines recognizes an outrageously clever hack.
6ef01931fSBen Gras# Keith Waclena <keith@cerberus.uchicago.edu>
7ef01931fSBen Gras# Send additions to <perl5-porters@perl.org>
8ef01931fSBen Gras0	search/1	eval\ "exec\ /bin/perl		Perl script text
9ef01931fSBen Gras!:mime	text/x-perl
10ef01931fSBen Gras0	search/1	eval\ "exec\ /usr/bin/perl	Perl script text
11ef01931fSBen Gras!:mime	text/x-perl
12ef01931fSBen Gras0	search/1	eval\ "exec\ /usr/local/bin/perl	Perl script text
13ef01931fSBen Gras!:mime	text/x-perl
14ef01931fSBen Gras0	search/1	eval\ '(exit\ $?0)'\ &&\ eval\ 'exec	Perl script text
15ef01931fSBen Gras!:mime	text/x-perl
1608ff44c4SLionel Sambuc0	search/1	#!/usr/bin/env\ perl	Perl script text executable
1708ff44c4SLionel Sambuc!:mime	text/x-perl
1808ff44c4SLionel Sambuc0	search/1	#!\ /usr/bin/env\ perl	Perl script text executable
1908ff44c4SLionel Sambuc!:mime	text/x-perl
20*0a6a1f1dSLionel Sambuc0	search/1	#!
21*0a6a1f1dSLionel Sambuc>0	regex	\^#!.*/bin/perl$	Perl script text executable
22*0a6a1f1dSLionel Sambuc!:mime	text/x-perl
23ef01931fSBen Gras
24ef01931fSBen Gras# by Dmitry V. Levin and Alexey Tourbin
25ef01931fSBen Gras# check the first line
26ef01931fSBen Gras0	search/1	package
27ef01931fSBen Gras>0	regex		\^package[\ \t]+[0-9A-Za-z_:]+\ *;	Perl5 module source text
2884d9c625SLionel Sambuc!:strength + 10
29ef01931fSBen Gras# not 'p', check other lines
30ef01931fSBen Gras0	search/1	!p
31ef01931fSBen Gras>0	regex		\^package[\ \t]+[0-9A-Za-z_:]+\ *;
32ef01931fSBen Gras>>0	regex		\^1\ *;|\^(use|sub|my)\ .*[(;{=]	Perl5 module source text
3384d9c625SLionel Sambuc!:strength + 10
34ef01931fSBen Gras
35ef01931fSBen Gras# Perl POD documents
36ef01931fSBen Gras# From: Tom Hukins <tom@eborcom.com>
37835f6802SDirk Vogt0	search/1/W	\=pod\n		Perl POD document text
38835f6802SDirk Vogt0	search/1/W	\n\=pod\n	Perl POD document text
39835f6802SDirk Vogt0	search/1/W	\=head1\ 	Perl POD document text
40835f6802SDirk Vogt0	search/1/W	\n\=head1\ 	Perl POD document text
41835f6802SDirk Vogt0	search/1/W	\=head2\ 	Perl POD document text
42835f6802SDirk Vogt0	search/1/W	\n\=head2\ 	Perl POD document text
4384d9c625SLionel Sambuc0	search/1/W	\=encoding\ 	Perl POD document text
4484d9c625SLionel Sambuc0	search/1/W	\n\=encoding\ 	Perl POD document text
4584d9c625SLionel Sambuc
46ef01931fSBen Gras
47ef01931fSBen Gras# Perl Storable data files.
48ef01931fSBen Gras0	string	perl-store	perl Storable (v0.6) data
49ef01931fSBen Gras>4	byte	>0	(net-order %d)
50ef01931fSBen Gras>>4	byte	&01	(network-ordered)
51ef01931fSBen Gras>>4	byte	=3	(major 1)
52ef01931fSBen Gras>>4	byte	=2	(major 1)
53ef01931fSBen Gras
54ef01931fSBen Gras0	string	pst0	perl Storable (v0.7) data
55ef01931fSBen Gras>4	byte	>0
56ef01931fSBen Gras>>4	byte	&01	(network-ordered)
57ef01931fSBen Gras>>4	byte	=5	(major 2)
58ef01931fSBen Gras>>4	byte	=4	(major 2)
59ef01931fSBen Gras>>5	byte	>0	(minor %d)
60*0a6a1f1dSLionel Sambuc
61*0a6a1f1dSLionel Sambuc# This is Debian #742949 by Zefram <zefram@fysh.org>:
62*0a6a1f1dSLionel Sambuc# -----------------------------------------------------------
63*0a6a1f1dSLionel Sambuc# The Perl module Hash::SharedMem
64*0a6a1f1dSLionel Sambuc# <https://metacpan.org/release/Hash-SharedMem> defines a file format
65*0a6a1f1dSLionel Sambuc# for a key/value store.  Details of the file format are in the "DESIGN"
66*0a6a1f1dSLionel Sambuc# file in the module distribution.  Magic:
67*0a6a1f1dSLionel Sambuc0	bequad	=0xa58afd185cbf5af7	Hash::SharedMem master file, big-endian
68*0a6a1f1dSLionel Sambuc>8	bequad	<0x1000000
69*0a6a1f1dSLionel Sambuc>>15	byte	>2	\b, line size 2^%d byte
70*0a6a1f1dSLionel Sambuc>>14	byte	>2	\b, page size 2^%d byte
71*0a6a1f1dSLionel Sambuc>>13	byte	&1
72*0a6a1f1dSLionel Sambuc>>>13	byte	>1	\b, max fanout %d
73*0a6a1f1dSLionel Sambuc0	lequad	=0xa58afd185cbf5af7	Hash::SharedMem master file, little-endian
74*0a6a1f1dSLionel Sambuc>8	lequad	<0x1000000
75*0a6a1f1dSLionel Sambuc>>8	byte	>2	\b, line size 2^%d byte
76*0a6a1f1dSLionel Sambuc>>9	byte	>2	\b, page size 2^%d byte
77*0a6a1f1dSLionel Sambuc>>10	byte	&1
78*0a6a1f1dSLionel Sambuc>>>10	byte	>1	\b, max fanout %d
79*0a6a1f1dSLionel Sambuc0	bequad	=0xc693dac5ed5e47c2	Hash::SharedMem data file, big-endian
80*0a6a1f1dSLionel Sambuc>8	bequad	<0x1000000
81*0a6a1f1dSLionel Sambuc>>15	byte	>2	\b, line size 2^%d byte
82*0a6a1f1dSLionel Sambuc>>14	byte	>2	\b, page size 2^%d byte
83*0a6a1f1dSLionel Sambuc>>13	byte	&1
84*0a6a1f1dSLionel Sambuc>>>13	byte	>1	\b, max fanout %d
85*0a6a1f1dSLionel Sambuc0	lequad	=0xc693dac5ed5e47c2	Hash::SharedMem data file, little-endian
86*0a6a1f1dSLionel Sambuc>8	lequad	<0x1000000
87*0a6a1f1dSLionel Sambuc>>8	byte	>2	\b, line size 2^%d byte
88*0a6a1f1dSLionel Sambuc>>9	byte	>2	\b, page size 2^%d byte
89*0a6a1f1dSLionel Sambuc>>10	byte	&1
90*0a6a1f1dSLionel Sambuc>>>10	byte	>1	\b, max fanout %d
91