Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13. Miscellany > Item 120. Use Perl one-liners to create mini programs

Item 120. Use Perl one-liners to create mini programs

Perl’s heritage includes the world of system administration, where people like to create their entire programs on the command line. The perlrun documentation lists all of perl’s command-line options that make this possible, but you’ll get only the most popular ones in this Item.

Many of the normal style rules disappear on the command line. Lexical variables, descriptive names, and proper scoping don’t matter as much in short programs. Judicious use of default arguments (Items 15 and 16) saves space. Although you shouldn’t intentionally make your programs hard to read by making them as short as you can, you don’t want to make your one-liners hard to read by making them too long, either.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial