Hi Monks, Here is my piece of code--
sub per_user_qna_detail { for($index=0;$index<@records;$index++) { if($records[$index] =~ m/^(.*)\s*Morocco.*Entering\s*QnAModule +::authenticate/) { printf "INSIDE per_user_qna_detail on LINE NO $index\n"; $Time_Stamp = $1; search_for_username_and_no_of_questions(); end_block(); } } } sub search_for_username_and_no_of_questions { printf "ENTERING INSIDE search_for_username_and_no_of_questions ON + LINENO=$index\n"; for(;$index<@records;$index++) { #printf "LINENO=$index\n"; if ($records[$index] =~ /userName\s+:\[(..*)\]/) { $User_Name = $1; $User_Name =~ s/\s+//g; $User_Name= "'" . $User_Name . "'"; print "User_Name = $User_Name\n"; for(;$index<@records;$index++) { if ($records[$index] =~ /Set\s+of\s+questions\(bitmap\ +)\s+selected\s+:\s+(\d+)/) { print "Inside set of questions bitmap selected\n"; $Bitmap_Number_For_Questions = $1; printf "PRASANNA:$User_Name\n"; $no_of_questions{$User_Name}=$Bitmap_Number_For_Qu +estions; print "$Bitmap_Number_For_Questions is no of quest +ions for $User_Name\n"; $timestamp{$User_Name}=$Time_Stamp; print "$Time_Stamp is time stamp for $User_Name\n" +; printf "EXITING INSIDE search_for_username_and_no_ +of_questions ON LINENO=$index\n"; return 0; } } } } printf "EXITING INSIDE search_for_username_and_no_of_questions ON + LINENO=$index\n"; }
The code is working fine as expected if a user name is numeric, but if a username contains any special characters then it is failing. The snippet of the log file is this---
Entering QnAModule::authenticate pid 2172 tid 3124: 160: 10110847: userName :[app@abc.com] pid 2172 tid 3124: 160: 10110847: Set of questions(bitmap) selected : +7
and the other part is ---
QNA Step - AUTH IN PROGRESS pid 2172 tid 3124: 160: 10110851: QNA Auth - Success and Complete, Ret +urning SUCCESS Wed May 20 08:19:17.594 2009 Morocco Standard Time INFO: pid 2172 t +id 3124: 160: 10110851: Exiting QnAModule::authenticate ArAuthFrameworkImpl::doPostAuth::1:10110850:: Authentication mechanism + returned [0] for AuthIdentity [APP@ABC.COM]
The expected result is like this--
Fri May 29 18:52:06.967 2009 , 'abc_kal.nt' , 6 , "Success" Fri May 29 18:52:38.592 2009 , 'nt@abc.com' , 9 , "Success" Fri May 29 18:58:49.717 2009 , '12345678' , 12 , "Success" Fri May 29 18:59:34.107 2009 , 'app@abc.com' , 12 , "Failure" Fri May 29 19:00:00.936 2009 , '98765432' , 12 , "Failure"
and the final result which is coming is this--
Fri May 29 18:58:49.717 2009 , '12345678' , 12 , "Success" Fri May 29 19:00:00.936 2009 , '98765432' , 12 , "Failure"
for this snippet i am not getting the desired result. I did some googling and tried some options but they are not working for us. Kindly suggest something to get it working. Thanks NT

In reply to Specaila characters string not coming in final output file by namishtiwari

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.