in reply to How to display first line of each record using the question code
use strict; use warnings; use feature 'say'; local $/="__data__\n"; while (my $record=<DATA>){ # say "<$record>"; my @lines = split /\n/, $record; say $lines[0]; } __DATA__ 1aaaaaaaaaa aaaaaaaaaaa aaaaaaaaaaa __data__ 1bbbbbbbbbb bbbbbbbbbbb bbbbbbbbbbb __data__ 1cccccccccc ccccccccccc ccccccccccc __data__
output
1aaaaaaaaaa 1bbbbbbbbbb 1cccccccccc
> I need a solution that follows the code question...
what does this mean?
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to display first line of each record using the question code
by SatisfyMyStruggles (Initiate) on May 18, 2013 at 17:36 UTC | |
by LanX (Saint) on May 18, 2013 at 17:40 UTC | |
|