Intermediate Perl

By Tom Phoenix, brian d foy

Perl is a flexible, strong programming language utilized in numerous disciplines, starting from approach management to internet programming to database manipulation. One slogan of Perl is that it makes effortless issues effortless and difficult issues attainable. Intermediate Perl is set making the jump from the simple issues to the demanding ones.

Originally published in 2003 as Learning Perl items, References, and Modules and revised and up-to-date for Perl 5.8, this e-book bargains a gradual yet thorough creation to intermediate programming in Perl. Written through the authors of the best-selling Learning Perl, it selections up the place that ebook left off. issues include:

  • Packages and namespaces
  • References and scoping
  • Manipulating advanced information structures
  • Object-oriented programming
  • Writing and utilizing modules
  • Testing Perl code
  • Contributing to CPAN

Following the profitable structure of Learning Perl, we designed each one bankruptcy within the publication to be sufficiently small to be learn in exactly an hour or , finishing with a chain of routines that will help you perform what you may have realized. to take advantage of the publication, you simply have to be acquainted with the fabric in Learning Perl and feature ambition to head further.

Perl is a unique language to diversified humans. it's a fast scripting software for a few, and a fully-featured object-oriented language for others. it truly is used for every thing from acting quickly worldwide replacements on textual content documents, to crunching large, complicated units of clinical facts that take weeks to strategy. Perl is what you're making of it. yet despite what you employ Perl for, this e-book is helping you do it extra successfully, successfully, and elegantly.

Intermediate Perl is set studying to exploit Perl as a programming language, and never only a scripting language. this is often the e-book that turns the Perl dabbler into the Perl programmer.

Show description

Quick preview of Intermediate Perl PDF

Best Programming books

Joe Celko's SQL for Smarties: Advanced SQL Programming Third Edition (The Morgan Kaufmann Series in Data Management Systems)

SQL for Smarties used to be hailed because the first ebook committed explicitly to the complicated suggestions had to rework an skilled SQL programmer into a professional. Now, 10 years later and within the 3rd variation, this vintage nonetheless reigns best because the publication written via an SQL grasp that teaches destiny SQL masters.

Designing Audio Effect Plug-Ins in C++: With Digital Audio Signal Processing Theory

Not only one other theory-heavy electronic sign processing e-book, nor one other boring build-a-generic-database programming booklet, Designing Audio impact Plug-Ins in C++ provides every little thing you every thing you must comprehend to just do that, together with absolutely labored, downloadable code for dozens audio impact plug-ins and virtually awarded algorithms.

Effective C++: 55 Specific Ways to Improve Your Programs and Designs (3rd Edition)

“Every C++ expert wishes a replica of powerful C++. it's an absolute must-read for an individual taking into account doing severe C++ improvement. If you’ve by no means learn powerful C++ and also you imagine you recognize every thing approximately C++, reassess. ”— Steve Schirripa, software program Engineer, Google “C++ and the C++ group have grown up within the final fifteen years, and the 3rd version of powerful C++ displays this.

Cocoa Design Patterns

“Next time a few child exhibits up at my door inquiring for a code overview, this can be the booklet that i'm going to throw at him. ”   –Aaron Hillegass, founding father of substantial Nerd Ranch, Inc. , and writer of Cocoa Programming for Mac OS X   Unlocking the secrets and techniques of Cocoa and Its Object-Oriented Frameworks   Mac and iPhone builders are usually crushed through the breadth and class of the Cocoa frameworks.

Additional resources for Intermediate Perl

Show sample text content

If Perl runs out of reminiscence, all bets are off. Nested item Destruction If an item holds one other item (say, as a component of an array or the worth of a hash element), Perl DESTROYs the containing item earlier than any of the contained items start their discarding technique. this can be average as the containing item might have to reference its contents with a purpose to disappear gracefully. to demonstrate this, we construct a “barn” and tear it down. To be attention-grabbing, we’ll make the barn a blessed array reference, now not a hash reference: { package deal Barn; sub new { bless [ ], shift } sub upload { push @{shift()}, shift } sub contents { @{shift()} } sub break { my $self = shift; print "$self is being destroyed... \n"; for ($self−>contents) { print ' ', $_−>name, " is going homeless. \n"; } } } right here, we’re relatively being minimalistic within the item definition. To create a brand new barn, we bless an empty array reference into the category identify handed because the first parameter. including an animal pushes it to the again of the barn. soliciting for the barn’s contents in basic terms dereferences the thing array connection with go back the contents. the thrill half is the destructor. We take the connection with ourselves, demonstrate a debugging message concerning the specific barn being destroyed, after which ask for the identify of every inhabitant in flip. In motion, this could be: my $barn = Barn−>new; $barn−>add(Cow−>named('Bessie')); $barn−>add(Cow−>named('Gwen')); print "Burn the barn:\n"; $barn = undef; print "End of application. \n"; This prints: Burn the barn: Barn=ARRAY(0x541c) is being destroyed... Bessie is going homeless. Gwen is going homeless. [Gwen has died. ] [Bessie has died. ] finish of application. observe that Perl first destroys the barn, letting us get the names of the population cleanly. as soon as the barn is long past, the population don't have any extra references, in order that they additionally depart simply because Perl invokes their destructors, too. evaluate that with the cows having a lifestyles open air the barn: my $barn = Barn−>new; my @cows = (Cow−>named('Bessie'), Cow−>named('Gwen')); $barn−>add($_) for @cows; print "Burn the barn:\n"; $barn = undef; print "Lose the cows:\n"; @cows = ( ); print "End of software. \n"; This produces: Burn the barn: Barn=ARRAY(0x541c) is being destroyed... Bessie is going homeless. Gwen is going homeless. Lose the cows: [Gwen has died. ] [Bessie has died. ] finish of software. The cows will now proceed to dwell until eventually the single different connection with the cows (from the @cows array) is going away. The references to the cows disappear as soon as the barn destructor thoroughly finishes. occasionally, we may need as an alternative to shoo the cows out of the barn as we realize them. right here, it’s so simple as destructively changing the barn array, instead of iterating over it. we change the Barn to Barn2 to demonstrate this: { package deal Barn2; sub new { bless [ ], shift } sub upload { push @{shift()}, shift } sub contents { @{shift()} } sub wreck { my $self = shift; print "$self is being destroyed... \n"; whereas (@$self) { my $homeless = shift @$self; print ' ', $homeless−>name, " is going homeless.

Download PDF sample

Rated 4.45 of 5 – based on 18 votes