in reply to Re^2: Shorten a list...
in thread Shorten a list...
Chris#!/usr/bin/perl use strict; use warnings; my (@buffer, @data); while (<DATA>) { if (/^Group/) { push @data, [@buffer] if @buffer > 2; @buffer = $_; } else { push @buffer, $_; } } push @data, [@buffer] if @buffer > 2; { local $" = ''; print join("\n", map "@$_", @data); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Shorten a list...
by la (Novice) on Oct 17, 2011 at 21:51 UTC | |
by Cristoforo (Curate) on Oct 18, 2011 at 02:58 UTC | |
by la (Novice) on Oct 18, 2011 at 05:08 UTC | |
by Cristoforo (Curate) on Oct 18, 2011 at 15:59 UTC | |
by la (Novice) on Oct 18, 2011 at 17:12 UTC | |
|