.PL

PL File

Perl script source code file
Ask a question
QUICK ANSWER

A PL file is a Perl script - plain-text source code written in the Perl programming language. Open it in any text editor (Notepad, VS Code, Notepad++) to read or edit it. To run it, install Perl first; on macOS and Linux it is already included. On Windows, install Strawberry Perl, then run perl script.pl from a terminal.

Developer: Larry Wall (Perl, 1987); now maintained by the Perl core team / The Perl Foundation Category: Developer Files Open standard MIME: application/x-perl
OPENS ON Windows macOS Linux
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 16, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the PL file format?

.pl files store scripts written in the Perl programming language. Script code in a .pl file can be comprised of functions, operations, variables, constructors, classes, and comments.

Uses of .pl scripts

Perl is used for writing dynamic content and applications. .pl scripts are commonly used for text parsers and analyzers based on regular expressions, or reporting tools. .pl files can also contain scripts for servers, CGI web servers, or web apps. Perl scripts are also used in finance and bioinformatics for processing large amounts of data and implementing applications. CPAN, Perl's comprehensive module repository, provides thousands of ready-made libraries that .pl scripts can pull in with a single use statement.

.pl script syntax

Perl was designed with simplicity in mind and an emphasis on terse, expressive syntax. Code stored in .pl files may be challenging to read, especially for less-experienced programmers, due to Perl's flexible syntax and its heavy use of sigils - $ for scalars, @ for arrays, and % for hashes.

Additional information

Perl supports functional, object-oriented, and procedural programming paradigms. The first line of a .pl file commonly contains a shebang reference to the Perl interpreter - for example #!/usr/bin/perl or #!/usr/bin/env perl - though on Windows this line is optional. By convention, .pl marks a runnable script while reusable libraries use the .pm extension instead.

Security & safety

RISK: MEDIUM

A .pl file is human-readable text and cannot infect you merely by being viewed - open it in a text editor to inspect it safely. The risk is in RUNNING it: Perl scripts have full access to your files, network and system (delete files, download payloads, run shell commands), so a malicious .pl is as dangerous as any program. Never execute a Perl script from an untrusted source without reading it first; be especially wary of obfuscated code or scripts that fetch and eval remote content. CGI .pl scripts on old web servers are also a classic injection target if unmaintained.

Format details

in a nutshell
FULL NAMEPerl script source code fileaka Perl program, Perl source file
DEVELOPERLarry Wall (Perl, 1987); now maintained by the Perl core team / The Perl Foundationsince Perl 1.0 released December 18, 1987
MIME TYPEapplication/x-perl
TYPEPlain-text programming-language source code
STANDARDOpen · royalty-free
This extension is also used by…
  • Prolog source file (.pl) - SWI-Prolog and other Prolog systems use .pl for logic-programming source - same extension, unrelated language.
  • gnuplot script (.pl) - Some plotting/automation setups name gnuplot command scripts .pl; plain text, run by gnuplot.

Programs that open PL files

Windows4 apps
Notepad Open-source Open the .pl to read or edit it as text with Perl syntax highlighting (doesn't run it - Perl still required).
Visual Studio Code Free Open the .pl to read/edit with Perl syntax highlighting (add the 'Perl' extension); run via an integrated terminal with perl script.pl.
Strawberry Perl Open-source Install it, then run the script from Command Prompt: perl script.pl (Strawberry bundles a complete Perl + compiler toolchain).
ActiveState Perl (ActivePerl) Freemium Install the distribution, then execute perl script.pl. (Modern downloads go through the ActiveState Platform.)
macOS3 apps
BBEdit Freemium Open the .pl to read/edit; the free mode handles text, syntax highlighting and can run scripts via shell worksheets.
Perl (built-in) Open-source macOS ships Perl; open Terminal and run perl script.pl (or chmod +x then ./script.pl if it has a shebang).
Visual Studio Code Free Open to edit with the Perl extension; run in the integrated terminal.
Linux2 apps
Perl (built-in) Open-source Perl is preinstalled on most distros; run perl script.pl in a terminal (or ./script.pl after chmod +x).
Visual Studio Code Free Edit with the Perl extension and run via the integrated terminal.

Technical details

deep spec
MIME typeapplication/x-perl (also accepted: text/x-perl, text/plain)
EncodingPlain text - typically UTF-8 or ASCII; UTF-8 source is enabled explicitly with the `use utf8;` pragma
File structureLinear sequence of Perl statements: optional shebang, pragma/`use` declarations, subroutine definitions, and executable code - interpreted top-to-bottom at run time
Shebang lineOptional first-line `#!/usr/bin/perl` or `#!/usr/bin/env perl` tells Unix/macOS shells which interpreter to invoke; absent or ignored on Windows
Programming paradigmsProcedural, object-oriented, and functional - all three can coexist within the same `.pl` file
Typical file sizeA few hundred bytes to tens of KB for a single script; larger codebases split logic into `.pm` module files
Script vs. module convention`.pl` = standalone runnable script/program; `.pm` = reusable Perl package/module imported by other scripts
ExecutionRun directly with `perl script.pl`; not compiled to a native binary - the Perl interpreter parses and executes source at runtime
Feature-level declaration`use v5.36;` (or similar) inside the file requests a minimum Perl language version and activates the corresponding feature bundle
Sigil system`$scalar`, `@array`, `%hash` - mandatory prefix sigils distinguish data types and are a core syntactic feature of every `.pl` file
Platform supportLinux, macOS, Windows (via Strawberry Perl or ActivePerl), BSD, and any other OS that provides a Perl interpreter
Unicode handlingPerl 5 handles Unicode via the `use utf8;`, `use open`, and `use Encode` pragmas; without them, strings are treated as byte sequences
Related extensions`.pm` (Perl module), `.cgi` (CGI web script), `.t` (TAP test file), `.pod` (Plain Old Documentation)
CompressionNone - source is plain text; distribution as a self-contained executable uses PAR/`pp` packaging tools
ReleasedPerl 1.0 released December 18, 1987
Latest versionPerl 5.40 (2024); Perl uses .pl/.pm regardless of language version
Open standardYes · royalty-free
Specificationperldoc.perl.org

PL conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PL files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PL files.

Frequently asked questions

How do I open a .pl file?
To read or edit it, open it in any text editor (VS Code, Notepad++, Notepad). To run it, install Perl and execute perl script.pl in a terminal. macOS and Linux already include Perl; on Windows install Strawberry Perl or ActiveState Perl.
How do I run a Perl script on Windows?
Install Strawberry Perl (free), open Command Prompt in the script's folder, and type perl script.pl. You can also associate .pl with perl.exe so double-clicking runs it, though running scripts in a visible terminal is safer.
What's the difference between .pl and .pm?
By convention .pl is an executable Perl script or program you run directly; .pm is a Perl module (a reusable package/library) that other scripts load with use. Both are plain Perl source.
Is a .pl file always Perl?
Usually, but not always. The same extension is reused by Prolog (logic-programming source, full of clauses ending in '.') and occasionally gnuplot scripts. Check the contents: Perl uses $ @ % sigils and 'use strict;'.
Can I turn a Perl script into a .exe?
Yes, you can bundle the script with a Perl interpreter into a standalone Windows executable using PAR::Packer (pp -o app.exe script.pl) or Perl2Exe. It packages Perl alongside your code rather than compiling to native machine code.
Is it safe to run a .pl file someone sent me?
Treat it like any program. Viewing it as text is safe, but running it gives the script full access to your system. Read it first, and never run scripts from untrusted sources or that download/eval remote code.

References

1perldoc - perlintro (Perl introduction)perldoc.perl.org
2Perl.org - official Perl sitewww.perl.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.BINCD/DVD Disc Image (BIN/CUE)
3.MDMarkdown Document
4.RPMSGRestricted Permission Message
5.PARTPartial Download File
6.CRDOWNLOADChrome Partial Download File
7.NOMEDIAAndroid No-Media Marker File
8.PRDXSoftMaker Presentations Document
9.PRO6XProPresenter 6 Bundle File
10.SWFSmall Web Format (Shockwave Flash)

Related extensions

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

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z