in reply to Print selected records only?
use strict; use warnings; my $text = <<EOF; ================================================= Record 0 Name : John [John] I/C : >123< [123] Sex : 'Male' [Male] Ref : >12< [12] ================================================== Record 1 Name : Pretty [Pretty] I/C : >125< [125] Location : 'Female' [Female] Ref : >12< [12] ================================================== Record 2 Name : Kim [Kim] I/C : >124< [124] Location : 'Male' [Male] Ref : >11< [11] ================================================== EOF my @goods = grep /Ref\s+:\s+>12</, split /=+/, $text; # For this example print join "\n==================================================\n", +@goods;
Hope it helps,
deibyz
|
|---|