[grand-rapids-pm-list] Perl Puzzle

Ed Eddington Ed.Eddington at priorityhealth.com
Thu Jun 28 07:33:13 PDT 2007


I did receive a couple responses to the Perl puzzle - and a pretty tough contender for the fewest bytes. How low can you go? If you have a solution, pass it along. I'll reveal the winning code entries tomorrow. Below is a copy of the puzzle.

Again, the June meeting tomorrow is at Priority Health Conference Center from 11:30 -1PM. We will be having a discussion on "Large-Scale Development and Design Patterns". If you know you're coming, drop me a note so I can get an accurate count for pizza.

Ed Eddington
President GR Perlmongers
email: ed.eddington at priorityhealth.com
Ph 616.566.2462

> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>
> Perl Puzzle
>
> Here's a pretty basic problem. We need to add line numbers to each line of a text file. We need to turn this:
>
> This text file
> may have hundreds
> of lines of text
>
> ...into this:
>
> 1 This text file
> 2 may have hundreds
> 3 of lines of text
>
> Write a quick Perl script to accomplish this. Time can be money, so the first correct response will win their choice of book from our Library. Also, creativity counts, so a free book will also go to the person whose script accomplishes this with the fewest bytes of code (don't bother with 'use strict;' here!). Your script should accept a filename as a parameter and modify the file in place. Please email your code to me (not the list) by Thursday 5PM. Good luck!
>

** ** **  PRIVILEGED AND CONFIDENTIAL  ** ** **
This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above.  Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law.  If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please delete the email and immediately notify the sender via the email return address or mailto:postmaster at priorityhealth.com.  Thank you.

- end -



More information about the grand-rapids-pm-list mailing list