A Brief Perl Tutorial

JavaScript and Perl have some common features in terms of general structure, but Perl is unique and very powerful. One of the more powerful structures within Perl is a pattern-matching feature called regular expressions. JavaScript, too, has regular expressions; by comparing the two, you can learn about both. However, before getting to regular expressions, a quick overview of Perl is in order.

Unique Variable Characters of Perl

Perl distinguishes between different types of variables using a set of symbols with their own names. They include the following:

  • $ Scalar: a single number or string

  • @ Array: a multiple-item variable

  • % Hash: a paired array

A scalar is similar to a plain-vanilla variable in JavaScript.

Scalar Variables ...

Get JavaScript Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.