--- "Jonathan E. Paton wrote:
> > : #!/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.
>
Okay, more imagination required. Lets abuse the symbol
table since I'm bored, although this still can be construed
as using a hash... :( On the plus side, however, just
about everyone is using this one!
--- PERL SCRIPT ---
#!/usr/bin/perl -w
while (<>) {
eval qq(\*main\:\:A$.=sub { print \"$_\" });
}
if ($. == 0) { exit; }
my $middle = int ($. / 2) + 1;
eval qq(main\:\:A$middle\(\));
--- END PERL SCRIPT
Jonathan Paton
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music
Charts
http://uk.my.yahoo.com