INPUT: List1: //depot/asic/tools/perl/scripts/examples/modem.c#7

//depot/asic/tools/perl/files/examples/file.txt#2

//depot/asic/tools/perl/proc/examples/apps.c#14

Eg.//depot/asic/tools/perl/files/examples/fpower.cpp#2

List2: //depot/asic/tools/perl/scripts/examples/modem.c#6

//depot/asic/tools/perl/files/examples/file.txt#2

//depot/asic/tools/perl/proc/examples/apps.c#12

Eg.//depot/asic/tools/perl/files/examples/fpower.cpp#2

while (<IN>) { next unless ( m:(.+?)#(\d+)$: ); if ( exists( $pathname_versions{$1} )) { #pathname exists in list1 # compare the versions of the matching pathnames ,if the versi +on is lower in list2 print the #pathnames with both versions.Eg //depot/asic/tools/perl/scripts/e +xamples/modem.c#7-> 6. #Basically this block should find all the lower version pathnames +in list2 compared to list1 if ( exists( $pathname_versions{$1}{$2} )) { # we have a match on version# as well, so... #just print "duplicate file found" with the pathname and versi +on #Eg.//depot/asic/tools/perl/files/examples/fpower.cpp#2 } else { # version number wasn't seen in list1, so... #this case hardly araises,there will always be a version# asso +ciated #we can just print "No version number" } } else { #working on logic what if the pathnames doesn't match } }

In reply to Re^2: Comparing the filepaths and versions in two hashes by perl_mystery
in thread Comparing the filepaths and versions in two hashes by perl_mystery

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.