.PM file extension
To open .PM files on Windows, to read or edit: open the .pm file in a plain-text/code editor (use “Open with…” and choose your editor).
To open a .pm file, use a text/code editor (for reading/editing) or use Perl (for using it as a module in code). On Linux/macOS/Windows, .pm files are typically plain text containing Perl module code.
Last updated: May 4, 2026 · Reviewed by Julian Stricker
Open on your device
Choose your operating system for a dedicated step-by-step opening guide.
How to open .PM files
Use these platform-specific instructions to open .PM files safely.
Windows
- To read or edit: open the .pm file in a plain-text/code editor (use “Open with…” and choose your editor).
- To use it as intended: install Perl and load the module from a Perl script using Perl’s module mechanism (e.g., use/require).
- If Windows shows it as an unknown “PM Document File,” do not rename it—treat it as Perl source and open in a text editor.
Mac
- To read or edit: open the .pm file with a text/code editor (Control-click → Open With).
- To use it: ensure Perl is available and load the module from a Perl program using Perl’s module mechanism.
Linux
- To read or edit: open the .pm file in a text/code editor from your file manager or terminal.
- If your desktop uses shared-mime-info, it may classify .pm as a Perl-related text type (often text/x-perl); you can adjust file associations to open it in your editor.
- To use it: load the module from a Perl script (use/require) with Perl installed.
iOS
- iOS does not commonly “run” Perl modules; use Files to open it in a plain-text editor app (or transfer it to a desktop for development use).
Android
- Android does not commonly “run” Perl modules; open it in a plain-text/code editor app to view/edit, or transfer it to a desktop to use it with Perl.
Security notes
- .pm files are executable code in the sense that they can be loaded and run by Perl; do not run or install modules from untrusted sources.
- Be cautious with modules that execute code at load time (when imported/required), since simply loading a module can trigger actions.
- Because .pm files are plain text, a safe way to inspect them is to open in a text editor first; avoid blindly integrating unknown modules into automated scripts.
Recommended antivirus software
Scan files before opening them. These antivirus tools help protect against malware and viruses.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Can't open this file?
These are the most common causes and fixes when .PM files fail to open.
Common reasons
- The .PM file opens in the wrong app (or won’t open)
- Perl can’t find the module when running code
- The file looks like gibberish or has unexpected characters
- Web server or tool labels it as text/x-perl and you expected an official type
Fix steps
- Open it explicitly with a text/code editor using “Open with…”.
- If you need to execute or use it, install Perl and use it as a module from a Perl script rather than trying to “open” it as a document.
OS-specific troubleshooting
What is a .PM file?
A .pm file is a Perl module file: reusable Perl code packaged as a module that can be loaded with Perl’s module system. Perl module names map to paths ending in .pm (for example, Net/FTP.pm), and the file usually declares one or more packages. On many systems .pm is associated with an unregistered “x-” MIME type such as text/x-perl rather than an official IANA-registered type.
Background
In practice, “.PM” is most commonly seen in software development and system administration contexts where Perl is used. A Perl module is a reusable library of Perl code, distributed and installed so that Perl programs can load it when needed.
Perl’s documentation describes modules as files that use the .pm extension, and Perl module naming conventions commonly mirror directory paths (e.g., a module named Net::FTP is typically stored as Net/FTP.pm). This makes .pm files easy to organize and import.
On the web and in OS file-type databases, .pm may be labeled with a Perl-related MIME type such as text/x-perl. The “x-” prefix indicates a non-standard (unregistered) type in common use rather than an official IANA media type registration.
Common MIME types: text/x-perl
Further reading
Authoritative resources for more details on the .PM format.
Common .PM issues
The .PM file opens in the wrong app (or won’t open)
Many systems do not have a dedicated association for Perl module files, or they may be mislabeled as a generic “document.”
- Open it explicitly with a text/code editor using “Open with…”.
- If you need to execute or use it, install Perl and use it as a module from a Perl script rather than trying to “open” it as a document.
Perl can’t find the module when running code
Even with the .pm file present, Perl may not search the folder where it’s stored, or the module path/name may not match its location.
- Verify the file path matches the module namespace convention (e.g., Net/FTP.pm for Net::FTP).
- Ensure Perl’s module search path includes the module location (commonly done via Perl’s include paths as documented in perlmod).
The file looks like gibberish or has unexpected characters
A .pm file is normally plain text. If it looks binary or unreadable, it may be the wrong file type or corrupted.
- Confirm the file really is Perl source (open in a text editor and look for Perl code/package declarations).
- Re-download or re-transfer the file from the original source if it appears corrupted.
Web server or tool labels it as text/x-perl and you expected an official type
text/x-perl is a commonly used but non-IANA-registered (“x-” prefixed) MIME type used in some mappings for Perl files including .pm.
- Treat it as a conventional label rather than a guarantee of official standardization.
- If you manage a server, verify your Content-Type behavior and file handling using reputable MIME guidance (e.g., MDN) and your platform’s MIME database.
FAQ
Is a .pm file a “document”?
Usually no. The most common meaning of .pm is a Perl module source file (code), not an end-user document format.
Can I open a .pm file in Microsoft Word or a PDF viewer?
Typically no. A .pm file is plain text Perl code; open it with a text/code editor.
What does text/x-perl mean for a .pm file?
It’s a commonly used (but unregistered) MIME label seen in some systems for Perl-related source files, including .pm. It indicates Perl source content rather than an official IANA-registered media type.
Can I convert a .pm file by renaming the extension?
No. Renaming the extension does not convert the content. If you need a different format, you must actually transform the content (for example, copy/paste code into another file type) depending on your goal.
Similar file extensions
Compare related formats in the same category to find the right tool faster.