Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Perl

Submission + - Minimal Perl for Unix and Linux People

Ravi writes: "Perl (Practical Extraction and Report Language) — the language which was created by Larry Wall is arguably one of the greatest programming languages. But it has a reputation for taking an excessive cryptic nature which gives it an image especially among Perl novices as a language which is complex and hard to master.

The book titled "Minimal Perl — for Unix and Linux people", authored by Tim Maher and published by Manning Publications addresses these obstacles presented by Perl's complexity. This book which is divided into two parts comprising of a total of 12 chapters takes a unique methodology to explain the Perl syntax and its use. The author emphasizes on Perl's grep, awk and sed like features and relys on concepts such as inputs, filters and arguments to allow Unix users to directly apply their existing knowledge to the task of learning Perl.

What I found while reading this book is that the "Minimal Perl" is a specially crafted subset of Perl language designed to be easily grasped by people who have a Unix background and who wish to use Perl to write their scripts. Its main aim is to filter out the complex way of writing programs using Perl and stick to simple ways and where ever possible accomplish complex tasks using just one or two lines of Perl code. So in the first part of the book comprising of 6 chapters, the author explains how Perl can be used to do the same tasks as accomplished by common Unix tools such as grep, awk, sed and find. He goes one step further by explaining how one can accomplish much more and in a much simpler way by using the Perl techniques than can be achieved by using these tools.

Through out the book, the author consciously makes sure that the learning curve in acquiring Perl skills remain gentle. As Perl is a language whose syntax has a multitude of options, this book is peppered with numerous tables which provide excellent information at a glance. For example, in the third chapter titled "Perl as a (Better) grep command", the author lists and compares the fundamental capabilities of Perl and the different grep commands such as grep, egrep and fgrep which clearly shows the advantages that Perl has over grep. In another table, you get a birds eye view of the essential syntax of Perl's regular expressions and their meaning. This chapter alone has around 12 tables. This is a really nice feature of this book because it doubles this book as a ready reference for Perl where you can flip to the respective page and get the information you need.

The main strength and drawback of a language such as Perl is its dependence on regular expressions for accomplishing complex tasks. Once you master the regular expressions, the sky is the limit for ordering and segregating data using this language. And in Perl, there are more than one ways of doing the same thing. What is unique about this book is that the author specializes in explaining the easiest way of doing a particular task as is hinted by the title of the book.

In many places, the author demonstrates accomplishing complex tasks using just a few lines of Perl code. And many of the examples covered in this book are practical examples which give an idea of how the commands relate to the final outcome. For instance, while elaborating on the one line grep like commands in Perl, the author illustrates a web oriented application of pattern matching where he shows how to extract and list, the outline of slashdot.org site's front page. And the surprising thing is this is accomplished using just a single line of Perl code. This book has lots of such one liner examples which teaches how to use Perl intelligently using minimal effort.

If part I of this book focuses on ways in which simple Perl programs can provide superior alternatives to standard Unix commands, the second part comprising of another six chapters throws light on the other aspects of Perl concentrating on the syntax of the language and various built-in functions and modules available which does away with a lot of re-invention of the wheel — so to speak, and helps churn out code which is portable across OSes.

Chapter 7 titled "Built-in functions" introduces an eclectic mix of functions available in Perl. So you have functions which are used to extract a list of fields from a string, functions to access the current date and time, generating random numbers, sorting lists, transforming lists, managing files with functions and so on. These functions are broadly classified into those which generate and process scalars and those that process lists.

In chapter 8 of this book, the author involves the reader on the numerous scripting techniques that can be used to write better Perl programs.

It was quite surprising that the author has chosen to discuss the variables — more specifically the list variables comprising of arrays and hashes as well as the looping constructs only in the 9th and 10th chapters respectively when they should be some where up front. But on hind sight, I feel it is a good decision as once, you execute the one liner Perl programs in the initial chapters, by the time you reach the 9th chapter, you will be fairly confident in using Perl.

The last two chapters deal with creating sub-routines and modules. Over the years various Perl programmers have created modules which are used for diverse purposes. And with an aim to share these modules, they are collected and stored at one central place known as CPAN, which is an acronym for Comprehensive Perl Archive Network. The final chapter, apart from teaching how to create modules in Perl and manage them, also introduces the CPAN and ways in which one can find the right module by searching on CPAN.

The special variables cheat-sheet and the guidelines for parenthesizing code provided in the two appendices are really useful as a quick reference while writing Perl programs.

This is not a comprehensive book on Perl, rather the author specializes on a slice of Perl which when mastered can do over 95% of the jobs which require Perl. So for instance, you won't find object oriented concepts of Perl being mentioned in this book. But in many ways, the author has moved beyond explaining a subset of Perl by providing a section titled "Directions for further study" at the end of each chapter, where the author lists further material which can be used to learn more about the topic that is covered.

I really enjoyed going through this book on Perl, especially because it stresses on the practical side of using Perl and takes a minimal approach which does away with some of the seemingly complex nature of this language.

Ravi Kumar maintains a blog titled "All about Linux" where he shares his thoughts and experiences in using Linux, Open Source and Free software."
Software

Submission + - Groupware's Best-Kept Secret

IO ERROR writes: "ServerWatch reports on Groupware's Best Kept Secret: a 'a genuine turnkey messaging suite — install it and start using it. No muss, no fuss; just a nice integrated package all ready to go to work.' Sound like a broken promise? Not so; it's stable and you can get it now. Groupware's Best-Kept Secret 'comes with all the goodies expected in groupware: IMAP, POP3, SMTP, group calendars, contact lists, to-dos, shared folders, and an instant messaging client. It supports all the usual stand-alone mail and groupware clients, like KMail, Evolution, and good old Outlook. Even better is its Web client interface. If you standardize on Firefox, you'll have a single cross-platform client to support and no client configuration drama.'"
AMD/OSTG

Journal Journal: Alienware Media Centre With Built In 100Watt Amplifier

If you're at this year's CES show in Las Vegas you might see the new Alienware Media Centre . "The all-in-one system combines an AMD-based digital media platform with PC functionality and an AVR internal audio amplifier. At the heart of the DHS A Series amplifier lays an advanced D2Audio Digital Audio EngineT (DAE-1) Class-D PWM controller with an integrated DSP.D2Audio is the first d
Education

Submission + - GUIDE: How to surf anonymously using TOR

hakz writes: "Want a way to surf anonymously, but don't want to use a program that simply searches for proxies that can be found on Google? You can use a program called Tor, which will let you surf and use many different applications online anonymously. Tor uses many different computers as gateways, the data goes through many different computers and finally onto the destination you want. All the traffic between you and the destination is encrypted so no one other than you can see what you are doing."
Media

Submission + - Host Podcasts for Free Using Amazon S3

bogeydope writes: http://www.opens3.com/ A new web 2.0 domain called "openS3" is offering bloggers, podcasters and vidcasters an alternative, free method to hosting their rich media. All they have to do is enter their feed and openS3 will capture their media and upload it to Amazon's S3 Service. They will be given a direct link to syndicate their media as well as a torrent file.
The Internet

Journal Journal: Video Broadcast Sites Newest Threat to Our Children 3

The New York Times is breathlessly reporting on the rising danger facing our nation's children: video broadcast sites. Unlike video-upload sites, like the previous banes-of-our-children YouTube and Google Video, these new websites offer live video broadcasts and chats between their users. The kicker: these websites promise no monitoring by their staff for conduct or misbehavior. Will Stickam and PalTalk become the

Programming

Journal Journal: [programming] Is Hibernate Worth It? 7

I've got into a little debate/argument with a former boss over how to code up a new Java web application. I suggested looking into Hibernate (which I know very little about) to ease up on the developers. He thought we should take control of writing the SQL because there might be too much overhead. Does Hibernate, or any relational mapping library, cause enough slow downs to resort to writing SQL? Is Hibernate really going to make my database and application that much easier to maintain?

AMD/OSTG

Journal Journal: NVIDIA Introduces the Heart of "Megatasking"

NVIDIA has a new motherboard, the NVIDIA nForce 680a SLI , designed specifically for the new AMD Quad FX Platform with Dual Socket Direct Connect Architecture. This is not for the faint of heart...it's for the 'Megatasker'. "The exclusive core-logic launch partner for AMD Quad FX processors, the NVIDIA nForce 680a SLI MCP provides processing capabilities on a massive scale, by allowing multimedia and megata
Software

Submission + - You can now run the Slingbox SlingPlayer on Linux!

MrBlockHaus writes: "Like Linux? Like the Slingbox (you know — watch your TV from anywhere)? Just as slingers rejoiced with euphoria at the announcement of the SlingPlayer for Mac, now it's available for Linux as well. Explicit how-to instructions for watching your home TV from anywhere in the world that runs Linux ... on the Slingbox official community at www.slingcommunity.com."
Education

Submission + - 100 facts we didn't know last year

An anonymous reader writes: The BBC has a list of 100 things we didn't know last year. Among the many highlights:
27. Just one cow gives off enough harmful methane gas in a single day to fill around 400 litre bottles.
14. Online shoppers will only wait an average of four seconds for an internet page to load before giving up.
20. Sex workers in Roman times charged the equivalent price of eight glasses of red wine.
23. More than one in eight people in the United States show signs of addiction to the internet, says a study.

Slashdot Top Deals

"Sometimes insanity is the only alternative" -- button at a Science Fiction convention.

Working...