Online Perl Compiler
Run Perl scripts online with Perl 5.40. Write a script, press Run, and see what it prints beside your code, with warnings and errors shown with their line numbers. Scripts can read input from STDIN as they run, and the core modules that ship with Perl are included.
How to run Perl code online
- This page opens with Perl selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
Perl 5.40 on Online IDE
- Scripts run with the perl command, so print writes straight to the output panel.
- <STDIN> reads a line of input: type it in the output panel and press Enter. Use chomp to drop the newline.
- Add use strict and use warnings to catch typos. Errors and warnings show the file name and line number.
- Perl's core modules are included. Modules from CPAN are not installed.
Example: a Perl program that reads input
use strict;
use warnings;
print "Enter some words: ";
chomp(my $line = <STDIN>);
my %count;
$count{lc $_}++ for split ' ', $line;
for my $word (sort keys %count) {
print "$word: $count{$word}\n";
}
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which Perl version does Online IDE use?
Perl 5.40, run with the perl command on Linux.
How do I read input in a Perl script?
Read from <STDIN> where you need a line, then type it in the output panel and press Enter.
Can I use CPAN modules?
The modules that come with Perl, such as List::Util, Data::Dumper and POSIX, work. Modules from CPAN are not installed, and scripts cannot download them.
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.