Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to XCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Few languages have shaped text processing like Perl. Created by Larry Wall in 1987, its regular-expression engine became so influential that 'Perl-compatible regex' is now an industry term of its own. Modern Perl is actively maintained — the 5.40 and 5.42 releases (2024-2025) shipped the new built-in class syntax, and Booking.com, cPanel, and DuckDuckGo still run substantial Perl in production, while BioPerl remains a workhorse in bioinformatics pipelines. Perl's one-liners and CPAN heritage make it a favorite for sysadmins gluing systems together. Run Perl here in a real interactive terminal: your script executes live, output streams as it prints, and anything you type feeds straight into <STDIN> — no local install, no setup.
use strict;
use warnings;
print "What's your name? ";
chomp(my $name = <STDIN>);
print "Hello, $name!\n";
print "Enter comma-separated numbers: ";
chomp(my $line = <STDIN>);
my @nums = split /\s*,\s*/, $line;
my @squares = map { $_ * $_ } @nums;
print "Squares: @squares\n";
my ($max) = sort { $b <=> $a } @nums;
print "Largest number you entered: $max\n";
Perl shows up wherever text needs wrangling: log analysis on Linux servers, ETL glue scripts, and legacy web backends that still power hosting panels and internal tools. Students meet it in bioinformatics courses through BioPerl, and sysadmins reach for it when a shell script gets too hairy but a full application is overkill. It is also a practical playground for mastering regular expressions — the skill transfers directly to grep, sed, Python, and JavaScript. Test one-liners, practice regex captures, or debug an inherited script right in the browser.
Yes. The terminal on this page is fully interactive, not a pre-filled input box. When your script hits a line like my $x = <STDIN>, execution pauses and waits for you to type, exactly as it would in a local shell. Prompts printed with print appear immediately, so multi-step interactive scripts behave naturally.
A modern Perl 5 interpreter from the actively maintained release line, so contemporary features such as say (with use feature), postfix dereferencing, and signatures are available. It is standard perl, not a restricted subset — strict, warnings, and the full core module set all work as documented.
No. The sandbox runs a single file against Perl's core distribution, so cpan or cpanm installs are not available. That still leaves a lot: core modules like List::Util, Data::Dumper, POSIX, Time::HiRes, and Getopt::Long ship with Perl and cover most exercises and interview problems.
main.plperl<STDIN>print "Hello from Perl!\n";
print "Welcome to XCODX Online Compiler!\n";
my $name = "Developer";
print "Hello, $name!\n";