Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Get me excited about perl

by grizzley (Chaplain)
on Sep 20, 2012 at 08:33 UTC ( #994610=note: print w/replies, xml ) Need Help??

in reply to Get me excited about perl

When I was preparing similar presentation, I started by stealing Damian Conway's slide from YAPC (sorry Damian!) with one smile emoticon in the middle (just say you are happy they are all here listening to you).

I focused on what is Perl best at: on logs/text processing. I showed a simple file doing: read input file->read line-by-line->do something on each line->write to output file, something like this:

open FIN, ... or die ...; open FOUT, ... or die ...; while($line = <FIN>) { $line =~ s/somepattern/somethingelse/g; } close FIN; close FOUT;
and then started cutting lines introducing $_, -n output redirection and ending with
perl -ne "s/somepattern/somethingelse/g" infile > outfile

It was seven slides I guess. After fifth slide audience started begging me not to annihilate whole code... :)

Then I presented list operations (easy inserting, deleting, merging, dynamic allocation, no bothering about memory, out-of-the range problems, etc.). C++ developers were target of this part of presentation.

Then one real problem: we had to deal with some Java problem of too long subroutine (it could not be longer than 64kB or something). Subroutine was generated automatically from variables list, 1000 times like:

setVarAndDoSomething(varname1, value1);
so perl script had to just split this sub into subs of no more than 64kB. So again operating on text, script was about 20 lines long, basically "read sub from file"->"cut into lines"->"glue together lines to chunks of no more than 64kB"->"replace old sub with set of new ones". To ilustrate it I found pictures: "book" -> "scissors" -> "glue" -> "Indiana Jones replacing golden statue with sack of dirt".

And at the end I've added info about CPAN, tons of modules, self-testing modules, etc.

Audience was delighted with power of Perl. So to sum it up: I presented what I like and use most: text processing, power of pure language and core modules. It would be best for you to think how you use Perl and present your way of making your own life easier. And of course remember about good presentation practices: less text, more pictures, present only main ideas on screen, etc.

Good luck!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994610]
[Discipulus]: there is a way on linux to produce { using ALT-123 keypad sequence?

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2017-12-13 10:25 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (355 votes). Check out past polls.