Hi Monks,
This is the first iteration of my thinking process to handle this issues, What I am trying to do is have format that prints values in an array with seperations but without repeating the the prefix of the sentence (I know the above words doesn't mean anything I tried my best to explain in words..)
This is what I really want to do,
The name William could be Willy, Will, Bill
So here is the code..

entire %nicknames is too big to put it here, I know you guys get the idea right ..

#hash table that contains nicknames %nicknames = ( Abe => 'Abraham', Abram => 'Abraham Abe', Bill => 'William Will', Will => 'Bill William willy', );

Part of my code which handles the above hash


=pod Idea is to match the nick name with the correct first name and return the correct name which matches with the user entered nick name. =cut sub matchNickname { my $nickTemp; foreach my $key(keys %nicknames) { my $value = $nicknames{$key}; if(lc $name eq lc $key){ print "user typed ".$name." Match the key ".$key." and val +ue is $value\n\n"; $nickTemp = $value; @nickArray = split '\W+', $nickTemp; foreach $nickTemp(@nickArray) { if($DEBUG){print "The name $name could be <$nickTemp> +or ";} } } #print "$key ==> $value\n"; #print "$nickTemp\n"; } #print "Value of nickTemp is $nickTemp\n"; }
Thanks in advance
LearnPerl

In reply to Help on format or better way to do..? by learnperl

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.