Telemachus wrote:
On Mon Nov 17 2008 @ 10:21, John W. Krahn wrote:
Set paragraph mode.
while (<>) {
Read a paragraph into $_. In your example a paragraph is:
" field:value
field:value
field:value
"
my @fields = split /^([^:]+):\s*/m;
Since there are multiple lines in a parag
On Mon, Nov 17, 2008 at 13:21, John W. Krahn <[EMAIL PROTECTED]> wrote:
snip
>> push(@Array_of_Records, { map /(.*)/, @fields });
>
> Store the fields as a hash at the end of @Array_of_Records. The filter
> /(.*)/ ensures that no newlines are included in the keys or values of the
> hash.
snip
On Mon Nov 17 2008 @ 10:21, John W. Krahn wrote:
> Set paragraph mode.
>
>> while (<>) {
>
> Read a paragraph into $_. In your example a paragraph is:
>
> " field:value
> field:value
> field:value
>
> "
>
>> my @fields = split /^([^:]+):\s*/m;
>
> Since there are multiple lines in a p
Telemachus wrote:
Good morning,
Hello,
I'm using a recipe from The Perl Cookbook (11.10 for anyone browsing at
home) to produce a record structure from items in a text file. The text
file itself has a simple structure:
field:value
field:value
field:value
field:value
field:value
Good morning,
I'm using a recipe from The Perl Cookbook (11.10 for anyone browsing at
home) to produce a record structure from items in a text file. The text
file itself has a simple structure:
field:value
field:value
field:value
field:value
field:value
etc.
That is, the records are