Más en lo de leer N líneas y unirlas.

Ernesto Hernandez-Novich emhn at telcel.net.ve
Fri Feb 1 22:58:17 CST 2002


On Sat, 2 Feb 2002, Ernesto Hernandez-Novich wrote:
> Manténgase alejado de los niños pequeños. No maneje maquinaria pesada
> mientras lee esto. Use un sólo ojo para mirarlo y luego abra el otro
> _lentamente_.

Randall Schwartz acaba de llamarme imbécil.

my @buffer;
my $n = 2;
{
  my $t = $n - 1;
  push @buffer, scalar <IN>;
  redo unless eof(IN) or @buffer >= $n;
  $_ = join " ", at buffer;
  s/\n/ / while ($t--);
  print;
  @buffer = ();
  redo unless eof(IN);
}

Conciso y sin brujerías :-) TIMTOWTDI
-- 
Ernesto Hernández-Novich - Running Linux 2.4.17 i686 - Unix: Live free or die!
Trouble getting proper answers? RTFM and STFW.
Don't like my answers? Keep sending money for faster/longer ones.
Don't get it? FOAD. I mean it. Or procmail me to /dev/null (Ask me how!)
If you can't apt-get it, it isn't useful or doesn't exist.

------------------------------------------------------------------------
Enviar e-mail a <majordomo at pm.org> colocando en el cuerpo:
"UNSUBSCRIBE caracas-pm-list" para desuscribirse.
"INFO caracas-pm-list" para conocer las reglas de etiqueta.
------------------------------------------------------------------------



More information about the caracas-pm mailing list