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

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

From:
Greg Bacon
Date:
December 1, 2001 10:56
Subject:
Re: middle line (was Re: Daily Perl FAQ...)
Message ID:
200112011856.fB1Iu7hM032211@mail.hiwaay.net
In message <20011130231418.30177.qmail@web14604.mail.yahoo.com>,
    "=?iso-8859-1?q?Jonathan=20E.=20Paton?=" writes:

: #!/usr/bin/perl -w
: 
: $j++;
: 
: while (<>) {
:     $line{$.} = $_;
:     delete $line{$j++} if ($. == 2 * $j);
: }
: 
: print $line{$j};

A hash is an associative array and, thus, isn't kosher for the problem
as stated.

Greg



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