in reply to [Solved]: Query about regular expression

Thanks for your suggestions Anonymous Monk, ww and jeffa. I had started with ww suggestion and modified by code as
if ( $form_dump_after =~ m{(<li>average_)(.*?)(</li>)}s ) { $inside_li = "average_".$2; print $fh "Value of \$inside_li: \n$inside_li \n"; }
It gave me output as:
average_speed_answer 25 60 30 60 ^M<br /> calls_waiting 300 500 300 500 ^M<br /> many more rows here post_ivr_calls_handled Wisconsin 50 100 50 100 ^M<br /> post_ivr_calls_handled Wyoming 50 100 50 100 ^M<br />
But I think I'll have to use HTML::TokeParser::Simple for the next tasks. I don't have HTML::TreeBuilder::XPath available and being in restricted env can't get it very easily, so can't check that out :-(

Some reference not related to this question directly: Actually all this that I am doing is for one simple goal, to be able to track the parameters (HTML form fields) that were changed from a dynamic web page. I am having hard time getting JavaScript to work and so took a very long path:

1. Took a snapshot of the DB fields that are displayed when the web page is fetched/loaded for first time.

2. Passed these fields in a hidden HTML form element, when the page is fetched/loaded for the first time

3. When the changes are made in the web page and form is submitted (when submit button is clicked) took a dump of all the paramaters passed using $query->Dump. This includes the hidden element which has the data before any changes were made in the form elements and the other normal paramaeters which has changes made by user.

4. And finally I am trying to put these two fields (before changes and after changes) in two arrays and compare the array elements to find the difference so I can get what fields were changed.

5. As of now, I am trying to make format of both arrays same so I can do the comparison.

If anyone knows a better approach then I would be glad to explore that. I'll post the update here when I'll finally be able to do it.

Thanks again!