summaryrefslogtreecommitdiffstats
path: root/magic/Magdir/perl
blob: 4a3756a483e17eea08fa8e808da6a0ed46229c80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#------------------------------------------------------------------------------
# $File: perl,v 1.27 2023/07/17 16:01:36 christos Exp $
# perl:  file(1) magic for Larry Wall's perl language.
#
# The `eval' lines recognizes an outrageously clever hack.
# Keith Waclena <keith@cerberus.uchicago.edu>
# Send additions to <perl5-porters@perl.org>
0	search/1024	eval\ "exec\ perl		Perl script text
!:mime	text/x-perl
0	search/1024	eval\ "exec\ /bin/perl		Perl script text
!:mime	text/x-perl
0	search/1024	eval\ "exec\ /usr/bin/perl	Perl script text
!:mime	text/x-perl
0	search/1024	eval\ "exec\ /usr/local/bin/perl	Perl script text
!:mime	text/x-perl
0	search/1024	eval\ 'exec\ perl		Perl script text
!:mime	text/x-perl
0	search/1024	eval\ 'exec\ /bin/perl		Perl script text
!:mime	text/x-perl
0	search/1024	eval\ 'exec\ /usr/bin/perl	Perl script text
!:mime	text/x-perl
0	search/1024	eval\ 'exec\ /usr/local/bin/perl	Perl script text
!:mime	text/x-perl
0	search/1024	eval\ '(exit\ $?0)'\ &&\ eval\ 'exec	Perl script text
!:mime	text/x-perl
0	string	#!/usr/bin/env\ perl	Perl script text executable
!:mime	text/x-perl
0	string	#!\ /usr/bin/env\ perl	Perl script text executable
!:mime	text/x-perl
0	string	#!
>0	regex	\^#!.*/bin/perl([[:space:]].*)*$	Perl script text executable
!:mime	text/x-perl

# by Dmitry V. Levin and Alexey Tourbin
# check the first line
0	search/8192	package
>0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*([[:space:]]v?[0-9][0-9.]*)?[[:space:]]*;	Perl5 module source text
!:strength + 40
# not 'p', check other lines
0	search/8192	!p
>0	regex		\^package[[:space:]]+[0-9A-Za-z_:]+[[:space:]]*([[:space:]]v?[0-9][0-9.]*)?[[:space:]]*;
>>0	regex		\^1[[:space:]]*;|\^(use|sub|my)[[:space:]].*[(;{=]	Perl5 module source text
!:strength + 75

# Perl POD documents
# From: Tom Hukins <tom@eborcom.com>
0	search/1024/W	\=pod\n		Perl POD document text
0	search/1024/W	\n\=pod\n	Perl POD document text
0	search/1024/W	\=head1\ 	Perl POD document text
0	search/1024/W	\n\=head1\ 	Perl POD document text
0	search/1024/W	\=head2\ 	Perl POD document text
0	search/1024/W	\n\=head2\ 	Perl POD document text
0	search/1024/W	\=encoding\ 	Perl POD document text
0	search/1024/W	\n\=encoding\ 	Perl POD document text


# Perl Storable data files.
0	string	perl-store	perl Storable (v0.6) data
>4	byte	>0	(net-order %d)
>>4	byte	&01	(network-ordered)
>>4	byte	=3	(major 1)
>>4	byte	=2	(major 1)

0	string	pst0	perl Storable (v0.7) data
>4	byte	>0
>>4	byte	&01	(network-ordered)
>>4	byte	=5	(major 2)
>>4	byte	=4	(major 2)
>>5	byte	>0	(minor %d)

# This is Debian #742949 by Zefram <zefram@fysh.org>:
# -----------------------------------------------------------
# The Perl module Hash::SharedMem
# <https://metacpan.org/release/Hash-SharedMem> defines a file format
# for a key/value store.  Details of the file format are in the "DESIGN"
# file in the module distribution.  Magic:
0	bequad	=0xa58afd185cbf5af7	Hash::SharedMem master file, big-endian
>8	bequad	<0x1000000
>>15	byte	>2	\b, line size 2^%d byte
>>14	byte	>2	\b, page size 2^%d byte
>>13	byte	&1
>>>13	byte	>1	\b, max fanout %d
0	lequad	=0xa58afd185cbf5af7	Hash::SharedMem master file, little-endian
>8	lequad	<0x1000000
>>8	byte	>2	\b, line size 2^%d byte
>>9	byte	>2	\b, page size 2^%d byte
>>10	byte	&1
>>>10	byte	>1	\b, max fanout %d
0	bequad	=0xc693dac5ed5e47c2	Hash::SharedMem data file, big-endian
>8	bequad	<0x1000000
>>15	byte	>2	\b, line size 2^%d byte
>>14	byte	>2	\b, page size 2^%d byte
>>13	byte	&1
>>>13	byte	>1	\b, max fanout %d
0	lequad	=0xc693dac5ed5e47c2	Hash::SharedMem data file, little-endian
>8	lequad	<0x1000000
>>8	byte	>2	\b, line size 2^%d byte
>>9	byte	>2	\b, page size 2^%d byte
>>10	byte	&1
>>>10	byte	>1	\b, max fanout %d