Skip to Content
Perl Debugged
book

Perl Debugged

by Peter Scott, Ed Wright
March 2001
Intermediate to advanced
288 pages
4h 56m
English
Addison-Wesley Professional
Content preview from Perl Debugged

4.1. Syntactical Sugaring

Perl has an unjustified reputation as a write-only language. We suspect this is because programmers who have never seen it before think they should be able to understand what's going on the first time they lay eyes on a statement the way they could with a BASIC program. But Perl provides many concise idioms and syntactic shortcuts that make programs much shorter than they would have been, and all you need is enough familiarity with the idioms.

4.1.1. The Variable That Wasn't There

A frequent source of bafflement for newcomers is the way that Perl programs seem to be talking to themselves:

while (<STDIN>)
   {
   chomp;
   s/#.*//;
   next unless /\S/;
   # ...
   }

This apparently defies the usual paradigm of functions operating on ...

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.
Start your free trial

You might also like

Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe
Pro Perl

Pro Perl

Peter Wainwright
Intermediate Perl

Intermediate Perl

Randal L. Schwartz, brian d foy, Tom Phoenix
Perl Testing: A Developer's Notebook

Perl Testing: A Developer's Notebook

Ian Langworth, Chromatic

Publisher Resources

ISBN: 0201700549Purchase book