Suppose you have a regexp:

@results = map {/.+\/.+\/(.*).pm$/} @list;
My question is this: If the items in @list are both upper and lower case how do you make the first letter of selected items Uppercase(or lowercase) for all items? I tried several methods but none worked.

Thanks,

xenchu

Update:HyperZonk is correct. The answer I was looking for was the one BrowserUK provided. He was also correct about the errors in my regexp. I did not explain what I was trying to do. @list would contain all the files on my system that ended in .pm. I thought at the time that some of the modules had a lowercase as well as an uppercase version(I was wrong about that too). I was attempting to ensure that the resulting list had no duplicates. That is why the perfectly logical uc(@results) would not have been useful.

Anyway I thank you all. Everytime I ask a question on this site I become a better programmer.

xenchu

Update2:HyperZonk, the reason I don't require anything between the second slash and .pm is that I can't think of anything that fits. It is (or should be) a module name. I think I'll go buy a copy of Simple Regular Expressions for Morons. If it doesn't look too advanced.



****sigfilesigfilesigfilesigfilesigfilesigfilesigfilesigfile

Perl has one Great Advantage and one Great Disadvantage:

It is very easy to write a complex and powerful program in three lines of code.

********************************************

The Needs of the World and my Talents run parallel to infinity.

In reply to Uppercasing Regex Output by xenchu

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.