develooper Front page | perl.fwp | Postings from November 2001

middle line (was Re: Daily Perl FAQ...)

Thread Previous | Thread Next
From:
Greg Bacon
Date:
November 29, 2001 05:09
Subject:
middle line (was Re: Daily Perl FAQ...)
Message ID:
200111291309.fATD9AhM026575@mail.hiwaay.net
Yesterday, I saw an interesting related exercise.  Write a program that
reads the lines from a file and outputs the middle line.  The kicker is
that you can't use arrays.  (Note that there's a little ambiguity with
respect to the definition of "middle line" when the number of lines in
the file is even or when there is only one line.  Just pick a reasonable
definition and get to work.)

I'll post my solution in a day or two.

Greg

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About