Skip to Content
Embedding Perl in HTML with Mason
book

Embedding Perl in HTML with Mason

by Ken Williams, Dave Rolsky
October 2002
Intermediate to advanced
318 pages
8h 40m
English
O'Reilly Media, Inc.
Content preview from Embedding Perl in HTML with Mason

Appendix C. Text Editors That Understand Mason

In order to write Mason components, you don’t need anything fancy. You can do just fine with any old ramshackle text editor — even (horrors!) a word processor that can save as plain text will do.

However, an editor that helps you manage the details of the document you’re creating can be a nice mini-luxury. Several different editors can easily be trained to understand the structure of Mason components, with varying degrees of assistance (or interference, depending on how much help you’re looking for). In most cases, this is due to the work of Mason developers who created syntax definitions and offered them to the general public. If you find shortcomings, the polite thing to do is to drop a note to the developer, offering a fix if possible.

Emacs

Both authors of this book are enthusiastic users of Emacs and its wonderful cperl-mode for editing plain Perl code, courtesy of Ilya Zakharevich. However, while one can just turn cperl-mode on for an entire Mason component and get some basic syntax highlighting, brace matching, and indentation, the result is necessarily clumsy, since large parts of the component aren’t Perl code.

Michael Abraham Shulman, a Mason contributor from way back, developed a much nicer solution. His Multiple-Major-Mode Mode (mmm-mode) is a way to combine cperl-mode and html-mode (or sgml-mode, if you prefer), each in the correct region of the component. Of course, like a true hubristic programmer, Michael addressed the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Randal Schwartz on Learning Perl

Randal Schwartz on Learning Perl

Randal L. Schwartz
Perl & LWP

Perl & LWP

Sean M. Burke
Higher-Order Perl

Higher-Order Perl

Mark Jason Dominus

Publisher Resources

ISBN: 0596002254Errata Page