Hello monks I I had mangled up the code here is the thing again
#!/usr/local/bin/perl -w # analyse_map.perl # Generate a snapshot of audio registers using register log file, # Open map files (map_merc and rom.dld) open(MAP, "<map_merc") || die "Unable to open map_merc"; # Read map_merc : while(<MAP>) { if( ($titi, $toto) = /^|\n\.(\w+).+\n\t+\.\w+\W+(\w+)/m) { print($titi, $toto, " ", $., "\n"); } } #close(MAP);
This operation is performed on a C .map file which is listed below (juat a few lines) <CODE Link Editor Memory Map output input virtual section section address size file .begin 00002000 00000068 .begin a0000000 00000068 begin_flash.o _START a0000000 00000000 .copy_flash 00000000 00001488 .copy_flash a0001000 000001ac libbsp_qt1_aspic32.acopy_flash.o copy_from_flash a0001000 00000000 .CpDstBg 00003000 00000000 .text 00003000 00052be4 .boot 80003000 0000009c libbsp_qt1_aspic32.aboot.o HdwInit 80003000 00000000 end_SIF 80003080 00000000 .endtext 80055be4 00000000 .endtext 80055be4 00000000 end.o TextEnd 80055be4 00000000 .data 00180000 000004d0 .data 80201000 00000000 begin_flash.o StartData 80201000 00000000 </CODE> The thing I am trying to do is scan the line that begins with "." eg .begin etc and put it in the scalar $titi and then if there is a line just below which starts with a tab and then ".", get the second part which is the address. I hope this explaination is clear enough. If you need more explaination mail me at satyajeet.navalkar@philips.com Thanx. Saty

In reply to multi-line regex again by saty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.