I continue with this code and still trying to understand why my hash works but still get piles of warning saying
Use of uninitialized value at ./perl.m line 24, <FH> chunk 894. Use of uninitialized value at ./perl.m line 24, <FH> chunk 894. Use of uninitialized value at ./perl.m line 24, <FH> chunk 896. Use of uninitialized value at ./perl.m line 24, <FH> chunk 898. Use of uninitialized value at ./perl.m line 24, <FH> chunk 900. Use of uninitialized value at ./perl.m line 24, <FH> chunk 902. Use of uninitialized value at ./perl.m line 24, <FH> chunk 904. Use of uninitialized value at ./perl.m line 24, <FH> chunk 906. Use of uninitialized value at ./perl.m line 24, <FH> chunk 922. Use of uninitialized value at ./perl.m line 24, <FH> chunk 924. Use of uninitialized value at ./perl.m line 24, <FH> chunk 926. Use of uninitialized value at ./perl.m line 24, <FH> chunk 928. Use of uninitialized value at ./perl.m line 24, <FH> chunk 930. Use of uninitialized value at ./perl.m line 24, <FH> chunk 932. Use of uninitialized value at ./perl.m line 24, <FH> chunk 934. Use of uninitialized value at ./perl.m line 24, <FH> chunk 936. Use of uninitialized value at ./perl.m line 24, <FH> chunk 938. Use of uninitialized value at ./perl.m line 24, <FH> chunk 940. Use of uninitialized value at ./perl.m line 24, <FH> chunk 942. Use of uninitialized value at ./perl.m line 24, <FH> chunk 944. Use of uninitialized value at ./perl.m line 24, <FH> chunk 946.
Also, I try to debug this program, and I see that push happens twice(?) in one record. Why? There shoud be only one $callid and $sipm per record.
main::(perl.m:6): my $cbn = $"; DB<2> main::(perl.m:8): $/ = "\n\n"; DB<2> main::(perl.m:9): $" = "\n"; DB<2> main::(perl.m:11): open FH, 'file1' or die "can't open file $!"; DB<2> main::(perl.m:13): my $callid; DB<2> main::(perl.m:14): my $sipm; DB<2> main::(perl.m:15): my %data1 = (); DB<2> main::(perl.m:17): while (<FH>) { DB<2> main::(perl.m:18): chomp; DB<2> main::(perl.m:19): if (m/###|^$/) { DB<2> main::(perl.m:20): next; DB<2> main::(perl.m:18): chomp; DB<2> main::(perl.m:19): if (m/###|^$/) { DB<2> main::(perl.m:22): m{(?:^SIP\/2\.0 )?(\d\d\d|^[A-Z]{3,6} ). +*(Call-ID: [\S]{25,80})[^ ]+: .*}s; DB<2> main::(perl.m:23): ($sipm,$callid) = ($1,$2); DB<2> main::(perl.m:24): push (@{$data1{$callid}}, $sipm); DB<2> main::(perl.m:24): push (@{$data1{$callid}}, $sipm); DB<2> main::(perl.m:17): while (<FH>) { DB<2> main::(perl.m:18): chomp; DB<2> main::(perl.m:19): if (m/###|^$/) { DB<2> main::(perl.m:20): next; DB<2> main::(perl.m:18): chomp; DB<2> main::(perl.m:19): if (m/###|^$/) { DB<2> main::(perl.m:22): m{(?:^SIP\/2\.0 )?(\d\d\d|^[A-Z]{3,6} ). +*(Call-ID: [\S]{25,80})[^ ]+: .*}s; DB<2> main::(perl.m:23): ($sipm,$callid) = ($1,$2); DB<2> main::(perl.m:24): push (@{$data1{$callid}}, $sipm); DB<2> main::(perl.m:24): push (@{$data1{$callid}}, $sipm); DB<2> main::(perl.m:17): while (<FH>) {

In reply to Re^4: multiple values per key by convenientstore
in thread multiple values per key by convenientstore

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.