Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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]
[stevieb]: I have six cabins ready for anybody who is interested, free, at any time of year. You just have to be prepared to do some travel. I'm a couple hours from the coast mountains, and five from the Rockies. shmem, you have a lot of clout...
[shmem]: one week with -10 C and all going "whoo! we're gonna die!"
[stevieb]: I wouldn't even check your passport ;)
[shmem]: next week again +12
[stevieb]: In all seriousness, I have an open invitation to my ranch. Few take it up, but I have traveled and can tour more of this country than anyone I know
[stevieb]: hahaha -10c? For 1.5 months it was a near consistent -36f
shmem lifts an eyebrow at stevieb. Be warned...
[stevieb]: It's been hovering around -5c (dark) and +10c daytime and the snow is melting. The moose are leaving, and I expect the black and grizzly bears to come out of hibernation any time now. The lake is cracking up even. The warm weather, and...
[stevieb]: ...especially the lengthening of days has been beautiful. In dead winter (solstace) we had ~5 or less hours of daylight. Suddenly, here at sprint, we've got 12+.
[stevieb]: sprint =~ s/t/g/;

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2018-03-22 00:22 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (272 votes). Check out past polls.