← codetypingtest

Perl typing test

Perl is famous for packing a lot into one line, and its sigils make it unlike anything else to type: $ for single values, @ for arrays and % for hashes. Add my declarations, \n in double-quoted strings, => in hashes and -> to reach into references, and every line is a symbol workout.

Start the Perl typing test

What you'll type in Perl

Example: FizzBuzz in Perl

Each branch fits on one line, in braces, and every printed string ends with \n.

for my $i (1 .. 15) {
    if ($i % 15 == 0) { print "FizzBuzz\n" }
    elsif ($i % 3 == 0) { print "Fizz\n" }
    elsif ($i % 5 == 0) { print "Buzz\n" }
    else { print "$i\n" }
}

Type this program now

Tips for typing Perl faster

All 20 Perl programs

Every program is real, working Perl. Choose one to start typing it straight away.

Beginner

Intermediate

Advanced

Expert

How the test works

The timer starts on your first key and stops once every character is right. Press Enter for a new line and the indentation is filled in for you. A wrong key shows in red and counts as a mistake; press Backspace to go back and fix it. Your best time for each program is saved in your browser. Read more about how speed and accuracy are calculated, or get tips for typing code faster.

Other languages