Yeah, I just missed the multiple records in the same file. Mea culpa
Then you can do something like:
%length = (HDR => 5, FTR => 10); while(<DATA>) { while(/(HDR|FTR)/) # find either HDR or FTR { substr($_, $-[1], $length{$1}) = ''; # $-[1] is the position of +the first capture groups (parenthesis) } print; } __DATA__ HDR--Hello this is a test FTR-------Should there be text here? HDR--Tw +o records on the same line FTR------- HDR--and here an incomplete footer FTR--
In reply to Re^3: header footer
by Eily
in thread header footer
by gupr1980
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |