A full answer would take a book, but I'll do my best.
'What is the syntax for assigning values to local variables?' If you don't know the difference between 'local' and 'my', then use 'my'. 'local' variables are specialised and not often needed.
'my' variables can be visibile to other subroutines in the same script file - it is a question of where you declare them.
It is generally considered to be 'bad form' to globally share variables like this.
'Is there a standard for how many spaces to leave between the variable name and the assignment operator?' Answer: no, just be consistent.
How does one know whether to enclose a value in single-quotes, double-quotes, parentheses, or nothing?' Single-quotes surround unalterable text - we don't want perl to mess with the text within single quotes. Using double quotes invites perl to 'interpolate' special characters. Usually use double quotes around scalars ($var) and arrays (@fred) and characters like \n, \t.
Parentheses are used for several things in Perl, but around variables it indicates a list. Nothing around a variable is usually fine, but around text is a bareword, which is usually wrong.
If you have written a program then you are a programmer - there is no going back. Ask, crib other people's code, practice. Never stop learning.

In reply to Re: local variable syntax by cdarke
in thread local variable syntax by yburge

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.