in reply to Read and captured selected input data ?

You asked a similar question before and we gave you the answer to this question Can't read files content I am not sure if you read the post, but the regex is all you have to change if you want to "extract". Now, when you say "extract" usually that means that you want to store that data as a variable, or create a structure. But, it really looks like you just want to change some input data and reformat it for output. The easiest way to do that is to read it a line at a time, and do a substitution like so:
use strict; while(<DATA>){ ~s/></>FREE</ if /Required Bearer Cap/; ~s/></>FREE</ if /Info Recei frm/; ~s/>FREE</>PRICELESS</ if /Perl Monks Help/; print; } __DATA__ LSB Length : 76 [4c] Version : >04< [04] Record length : 0 [00] Record Type : '1' [01] Efficiency Indicator : '0' Successful Term Type : '0' [00] Unefficiency Cause : 'f' Resource Alloc Ind : 'f' [ff] Term Origin : 'f' Term Indicator : 'f' [ff] Info Teleservice : 33 [21] Required Bearer Service : 255 [ff] Time Stamp 1 : >030720215113< [03 07 20 21 51 13] Country Code : 1 [00 00 01] Time Stamp 2 : >030720215113< [07 20 21 51 13] Input Info : >5341870393005150< [53 41 87 03 93 00 5 +1 50] List Of Invoked Supp Ser : >< List Information : >1960136771453< [91 06 31 76 17 54 f3] Price ID : >502130101789872< [05 12 03 01 71 98 78 + f2] Price Code : >910631420033f9< [91 06 31 42 00 33 f9] Discount Identity : >1960132400000< [91 06 31 42 00 00 f0] FOC Identity : >0085 3217< [05 f2 31 00 85 32 17] extension : >< Required Bearer Capability : >< Info Recei frm Fixed Supp : >< Hotdog at the park : >$5.00< Perl Monks Help : >FREE<


JamesNC

Replies are listed 'Best First'.
Re: Re: Read and captured selected input data ?
by bh_perl (Monk) on Jul 22, 2003 at 15:38 UTC
    Yes you are right james....But anyway, thanks for your attention, I'm very happy with you.. ;-) As your info, I have tried before, so many time and so many changes. But I'm failed. I'm failed when the items value is null or like this ><. So, I do not know where my mistake and why it's happened. Then, I made decision to ask Monks again with real info.