PERL (.perl)
.perl file signature | text/x-perl
Magic Bytes
Offset 0
65 76 61 6C 20 22 65 78 65 63 20 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 2F 70 65 72 6C
Sources: Apache Tika
All Known Signatures
5 signature variants are documented for .perl files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 65 76 61 6C 20 22 65 78 65 63 20 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 2F 70 65 72 6C | 0 | Apache Tika |
| 23 21 2F 62 69 6E 2F 70 65 72 6C | 0 | Apache Tika |
| 23 21 2F 62 69 6E 2F 65 6E 76 20 70 65 72 6C | 0 | Apache Tika |
| 23 21 2F 75 73 72 2F 62 69 6E 2F 70 65 72 6C | 0 | Apache Tika |
| 23 21 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 2F 70 65 72 6C | 0 | Apache Tika |
Extension
.perl
MIME Type
text/x-perl
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .perl files in Python
def is_perl(file_path: str) -> bool:
"""Check if file is a valid PERL by magic bytes."""
signature = bytes([0x65, 0x76, 0x61, 0x6C, 0x20, 0x22, 0x65, 0x78, 0x65, 0x63, 0x20, 0x2F, 0x75, 0x73, 0x72, 0x2F, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x2F, 0x62, 0x69, 0x6E, 0x2F, 0x70, 0x65, 0x72, 0x6C])
with open(file_path, "rb") as f:
return f.read(30) == signature
How to validate .perl files in Node.js
function isPERL(buffer: Buffer): boolean {
const signature = Buffer.from([0x65, 0x76, 0x61, 0x6C, 0x20, 0x22, 0x65, 0x78, 0x65, 0x63, 0x20, 0x2F, 0x75, 0x73, 0x72, 0x2F, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x2F, 0x62, 0x69, 0x6E, 0x2F, 0x70, 0x65, 0x72, 0x6C]);
return buffer.subarray(0, 30).equals(signature);
}
How to validate .perl files in Go
func IsPERL(data []byte) bool {
signature := []byte{0x65, 0x76, 0x61, 0x6C, 0x20, 0x22, 0x65, 0x78, 0x65, 0x63, 0x20, 0x2F, 0x75, 0x73, 0x72, 0x2F, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x2F, 0x62, 0x69, 0x6E, 0x2F, 0x70, 0x65, 0x72, 0x6C}
if len(data) < 30 {
return false
}
return bytes.Equal(data[:30], signature)
}
API Endpoint
/api/v1/perl
curl https://filesignature.org/api/v1/perl
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .perl file?
A .perl file is a PERL file.
What are the magic bytes for .perl files?
The magic bytes for PERL files are 65 76 61 6C 20 22 65 78 65 63 20 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 2F 70 65 72 6C at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .perl file?
To validate a .perl file, read the first bytes of the file and compare them against the known magic bytes (65 76 61 6C 20 22 65 78 65 63 20 2F 75 73 72 2F 6C 6F 63 61 6C 2F 62 69 6E 2F 70 65 72 6C) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .perl files?
The primary MIME type for .perl files is text/x-perl.
Is it safe to open .perl files?
PERL (.perl) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.