Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Your Favorite Heroic Perl Story

by holli (Monsignor)
on Jan 22, 2005 at 07:42 UTC ( #424206=note: print w/ replies, xml ) Need Help??


in reply to Your Favorite Heroic Perl Story

the set:
I was not long at my new job when i wrote some little tools for my personal ease, when my boss looked over my shoulder.

>> What is this?
<< That is perl. It is a language...
>> I know what is is, we donīt use that, itīs whacky.
>> But,
<< No but. We donīt use it!
>> Ah, ok. .oO(a*****e)Oo.

Two or three weeks later, i looked over the bosses shoulder while he tried to write a filter for a textfile (in VB) with heavy use of index(), substring() and ugly long if/else constructions. It ended up with 70 lines of code and three hours work.
I let him do that and in the meantime i prepared a one-liner in the

perl -n -e "print if //" infile>outfile
style (one line, 2 minutes).

When i showed it to him he was first angry and then amazed. And since that day we use perl a lot and i am the companies "chief of perl".

holli, regexed monk


Comment on Re: Your Favorite Heroic Perl Story
Download Code
Re^2: Your Favorite Heroic Perl Story
by demerphq (Chancellor) on Jan 22, 2005 at 09:32 UTC

    I got into perl by writing a tool that would parse and extend VB classes with DB interaction (automatically generate a DB schema to make the classes persistent as well as adding persistancy methods to the code). I have never really done any signifigant VB after that project, its all been perl since then pretty much. :-)

    ---
    demerphq

Re^2: Your Favorite Heroic Perl Story
by Anonymous Monk on Jan 24, 2005 at 15:56 UTC
    So, all you did was to reinvent grep? Because that's what a perl -ne 'print if //' is.
      Since this seems to be a Windows shop, they might not have grep. Plus, he might have preferred to use Perl for some reason. No need to be so judgmental.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://424206]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-07-01 21:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (22 votes), past polls