Kurt Faymon wrote at Thu, 19 Sep 2002 14:44:02 +0200:

> Given the Input of:
> 
> <H1>whatever.....
> <H2>whatever.....
> [...]
> 
> How can I read in the records bases on 'blocks starting with <H,, that is
> grouped as follows:
> 
> Record1:
> <H1>whatever.....
> <H2>whatever.....
> <H3>whatever.....
> <H4>whatever.....
> <p>whatever.....
> 
> Record2:
> <H2>whatever.....
> <H3>whatever.....
> <H4>whatever.....
> <p>whatever.....
> 
> [...]
> 
> Setting $/ to something? Use the Split function? having tried variations of
> these and/or postive and negative lookahead's have left me obviously missing
> something? Any ideas?

If these are really lines,
you could do something tricky:

my @record = ([]); # Initialize with an empty first record at the beginning
while (<>) {
   push @{$record[-1]};
   /^<p>/ and push @record, [];
}


Best Wishes,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to