Hi Monks, Here is my piece of code--
sub search_for_username_and_no_of_questions { for(;$index<@records;$index++) { if ($records[$index] =~ /userName\s+:\[(..*)\]/) { $User_Name = $1; print "User_Name = $User_Name\n"; $User_Name =~ s/\s+//g; 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; $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" +; return 0; } } } } }
suppose my user name is abc@$%, it is not getting stored in the user name filed. What can be the problem here. Thanks NT

20090809 Janitored by Corion: Restored content, as per Writeup Formatting Tips


In reply to special characters storage in perl 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.