in reply to Re^4: regular expression
in thread regular expression
#!/usr/bin/perl use strict; use warnings; my $flag=0; while(<DATA>){ if (/\{AUTHOR\}/){ $flag=1; next; } if (/^\{/){ $flag=0; next; } print $_ if $flag; } __DATA__ {TAG} tag1 {AUTHOR} By June Fletcher JOURNAL {TAG} tag2 TOM MacCUBBIN {DATA} data1 {AUTHOR} Richard White {AUTHOR} MacCUBBIN {SOUR}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: regular expression
by vitoco (Hermit) on Aug 16, 2009 at 20:37 UTC |