This is a bit vague, but guessing from your code snippet, I think all you want to do is wrap your strings in quotes.
While it may be handy to use barewords in the smallest of scripts, you may want to follow the advice in perldata, which says,
A word that has no other interpretation in the grammar will be treated as if it were a quoted string. These are known as ``barewords''. As with filehandles and labels, a bareword that consists entirely of lowercase letters risks conflict with future reserved words, and if you use the -w switch, Perl will warn you about any such words. Some people may wish to outlaw barewords entirely.
There's more in perldata about the much (and generally rightly) maligned bareword.

If this still doesn't make sense, compare the 2 short programs :

use strict; use diagnostics; my $foo=PerlBeginner; print $foo;
This will not run because PerlBeginner is not a core perl routine, and not a sub defined in the script, or in the strict or diagnostics modules.

Compare that with :

use strict; use diagnostics; my $foo="PerlBeginner"; print $foo;
Now replace "PerlBeginner" with "Perl Beginner", and see what happens. This compiles and runs because the string is wrapped in quotes. Also note the use strict and use diagnostics pragmas. These will alert you to the use of barewords (and other things) and enable verbose error messages for debugging, respectively. Most people consider the use of strict to be mandatory for scripts of any complexity.

If you don't like the idea of having to use quotes, look in perlop under "Quote and Quote-like Operators" for other ways to do it.

update : If this doesn't help you, or was way off base, please consider adding a little more descriptive content to your question; the three responses you've gotten so far are all over the field.


In reply to Re: Search for a character in CAPS (boo) by boo_radley
in thread Search for a character in CAPS by c_lhee

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.