.PM

Файл PM

Perl Module File
Задать вопрос
БЫСТРЫЙ ОТВЕТ

A PM file is a Perl module - a plain-text file of Perl source code that packages reusable functions and variables for other Perl programs to load with 'use'. Open it in any text editor (VS Code, Notepad++, vim) to read or edit the code. To run code that uses it you need Perl, which ships with macOS and Linux; on Windows install Strawberry Perl. A .pm is a library, not a standalone script - it is loaded by a .pl file, not run on its own.

Разработчик: Larry Wall / The Perl Foundation (Perl programming language) Категория: Файлы разработчика Открыть стандартное MIME: text/x-perl
ОТКРЫВАЕТСЯ НА Windows macOS Linux
Связанные: .DO · .MD · .HEX · .XSD

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Jun 30, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла PM?

A .pm file is a Perl module - a plain-text source file that packages reusable Perl code into a named namespace. The module system was introduced with Perl 5 in 1994 and remains the foundation of the CPAN ecosystem, which hosts hundreds of thousands of .pm modules.

Every .pm file declares its namespace near the top with a package statement (e.g., package HTTP::Tiny;) and conventionally ends with a bare 1; so that use or require can verify a successful load. There is no binary magic number; the file is identified by its .pm extension and the presence of a package declaration.

Module name and file path are directly linked: Foo::Bar maps to Foo/Bar.pm somewhere on Perl's @INC search path. A module is loaded by a .pl script or another module with use Module::Name; or require "Module/Name.pm".

Typical contents include:

  • Exported subroutines and variables (usually managed with Exporter)
  • Object-oriented class definitions
  • Embedded .pod documentation blocks
  • A version declaration via our $VERSION = '1.00';

Modules are interpreted at run time; .pmc files are an optional byte-code cache. The MIME type is text/x-perl and the encoding is usually UTF-8 or ASCII, declared with use utf8; when needed.

Безопасность и защита

РИСК: MEDIUM

A .pm file is plain text and safe to read or open in an editor - it cannot act by itself. The risk is in RUNNING it: Perl modules are executable code that can read/write files, run shell commands and make network calls, and code can even run at load time (BEGIN blocks, import logic) the moment a script does 'use Module;'. So treat an untrusted .pm like any program: read it before you load it, and don't run Perl code from sources you don't trust. The file sitting on disk is harmless.

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕPerl Module Fileтакже известен как Perl module, Perl library file
РАЗРАБОТЧИКLarry Wall / The Perl Foundation (Perl programming language)с 1987 (Perl 1.0); the .pm module convention dates to Perl 5 (1994)
MIME-ТИПtext/x-perl
ТИПPlain-text Perl source code (reusable module/package)
СТАНДАРТОткрытый · без роялти
СВЯЗАННЫЕ.do.md.hex.xsd
Это расширение также используется в…
  • Adobe PageMaker publication (.pm) - Older Aldus/Adobe PageMaker desktop-publishing documents used the .pm extension (later .pm5/.pm6/.p65/.pmd); open/convert in Adobe InDesign.

Программы, открывающие файлы PM

Windows4 apps
Notepad Открытый код Open the .pm as text with Perl syntax highlighting to read or quickly edit (no execution).
Perl (Strawberry Perl) Открытый код Install Strawberry Perl, then run a script that loads the module ('perl script.pl') or test it with 'perl -c Module.pm' to syntax-check.
Visual Studio Code (with Perl extension) Бесплатно Open the .pm to edit with syntax highlighting and (via the Perl Navigator/Language Server) linting and go-to-definition.
Padre (legacy Perl IDE) Открытый код Old dedicated Perl IDE; usable but largely unmaintained - prefer VS Code for new work.
macOS3 apps
TextMate Открытый код Open the .pm as text with Perl syntax highlighting for reading/editing.
Perl (built-in / Perlbrew) Открытый код macOS ships Perl; run scripts with 'perl', or use Perlbrew to manage versions. Syntax-check a module with 'perl -c Module.pm'.
Visual Studio Code (with Perl extension) Бесплатно Open the .pm to edit with syntax highlighting and (via the Perl Navigator/Language Server) linting and go-to-definition.
Linux2 apps
Perl (built-in) Открытый код Perl is preinstalled on virtually all Linux. Run scripts that 'use' the module, or 'perl -c Module.pm' to check it; 'perldoc Module.pm' reads its POD docs.
GNU Emacs / Vim Открытый код Open the .pm in cperl-mode/Emacs or Vim for full-featured Perl editing.

Технические подробности

глубокая спецификация
MIME typetext/x-perl (also accepted: application/x-perl, text/plain)
EncodingUTF-8 or ASCII; non-ASCII source requires an explicit `use utf8;` declaration
File structure`package` declaration → imports (`use`/`require`) → subroutines and variables → optional `Exporter` setup → embedded POD docs → trailing true value (`1;`)
Magic bytes / signatureNone; no binary signature. Identified by the `.pm` extension and a `package` statement near the top. An optional UTF-8 BOM (EF BB BF) may precede the first line.
Namespace-to-path mappingModule name maps directly to its file path: `Foo::Bar` resolves to `Foo/Bar.pm` on Perl's `@INC` search path
Loading mechanismCompile-time loading via `use Module;`; run-time loading via `require 'Module/Name.pm'` or `require Module::Name`
True-value terminatorMust end with a true value - conventionally bare `1;` - so the caller can confirm the file loaded without error
Version targetingMinimum Perl version declared with `use v5.xx;` or `use 5.010;`; no file-format version of its own
Typical file size1 KB - 200 KB per module
Export mechanismSubroutines and variables are selectively exposed to callers via the `Exporter` module using `@EXPORT` and `@EXPORT_OK` arrays
Documentation embeddingInline Plain Old Documentation (POD) blocks, delimited by `=pod` / `=cut`; parsed by `perldoc` and POD renderers
Byte-code cachePerl may store a pre-compiled form alongside the source as a `.pmc` file; the `.pm` itself is never compiled to a standalone binary
Obfuscation / encryptionPlain text by default; optional source filtering via modules such as `Filter::Crypto` or `Filter::Util::Call`
Associated platformsLinux, macOS, Windows (Strawberry Perl / ActivePerl), and any other OS where Perl is installed
Выпущен1987 (Perl 1.0); the .pm module convention dates to Perl 5 (1994)
Последняя версияPerl 5.40 (2024); Perl modules remain the standard library packaging unit
Открыть стандартноеДа · без роялти
Спецификацияperldoc.perl.org

Конвертации PM

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами PM. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах PM.

Часто задаваемые вопросы

What is a .pm file?
A Perl module - a plain-text file of Perl source code that packages reusable functions/variables for other Perl programs to load with 'use'. It's a library, not a standalone program.
How do I open a .pm file?
Any text editor reads it (Notepad++, VS Code, vim). To use the code you need Perl installed (built into macOS/Linux; Strawberry Perl on Windows) and a script that does 'use Module;'. Syntax-check it with 'perl -c Module.pm'.
How do I run a .pm file?
You don't run a module directly - it's loaded by a Perl script. Write or run a .pl script that does 'use Your::Module;' (the module must be on Perl's @INC path), then execute the script with 'perl script.pl'.
Is a .pm file the same as a .pl file?
Both are Perl source. A .pl is a runnable script (often with a #! shebang); a .pm is a reusable module (a 'package' ending in '1;') meant to be loaded by other code, not run on its own.
Do I need Perl to open a .pm file?
Only to run it. To read or edit the code, any text editor is enough. macOS and Linux already include Perl; on Windows install Strawberry Perl to execute code that uses the module.
How do I read the documentation in a .pm file?
Perl modules embed docs in POD format. Run 'perldoc Module.pm' to read it formatted, or convert it with pod2html/pod2pdf. You can also just open the .pm and scroll to the '=pod' sections.

Ссылки

1perldoc - perlmod (Perl modules)perldoc.perl.org
2Perl.org - official sitewww.perl.org

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.NOMEDIAAndroid No-Media Marker File
7.RPMSGRestricted Permission Message
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.SB3Scratch 3.0 Project File

Похожие расширения

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z