your code is based on a suggestion I made a few days ago in another thread that you opened (http://www.perlmonks.org/?node_id=1209051).
But, in that post, based on the data that you had originally shown, I was using an MSISDN line to detect the beginning of the new record block. You're now showing data where there is not always a line with an MSISDN. So you need to use something else to detect the beginning of a record. See my solution posted today (http://www.perlmonks.org/?node_id=1209603), where <SUBEND is used to detect the end of a block.
As I already pointed out in that previous thread, you're using too many parentheses in your regex, making your life more difficult than it needs to be.
For example, replace:
with:if (/^(\t*MSISDN=(\d+));/) {
and use $1 rather than $2.if (/^\t*MSISDN=(\d+);/) {
In reply to Re: Grouped Regular Expression not set assign default value
by Laurent_R
in thread Grouped Regular Expression not set assign default value
by gbwien
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |