Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
unless absolutely necessary...mucking about with the symbolic table--just to implement a shortcut to a programming problem--is generally not a great thing. in this particular case i think a closure would be a cleaner solution. even if you're just learning about symbolic table by using some code..it's better to have example code that uses the symbolic table for good reason, or you could get into a habit of using symbolic table in a similar fashion to the artificial example provided. anyway, that's my rant about symbolic tables in perl.
i like to read the ampersand in similar way to reading C, where it's literally "address of" operator. it's not exactly that in perl, but probably close enough for most purposes. so in that context the example line starting with ampersand would read: the address of an anonymous sub containing code/literal "color" is assigned the sub on the right hand side.
but as per my rant...it would be less error prone and clearer to have a sub that takes the color as a parameter, and do something with that. with subs/functions things are easily extended..you get into a fight with symbolic table manipulations if you (for example) add similar code for handling (say) transparency and visibility etc other parameters. the main program starts looking like spaghetti code.
the hardest line to type correctly is: stty erase ^H

In reply to Re: typeglob/symbolic reference question by aquarium
in thread typeglob/symbolic reference question by 7stud

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (3)
    As of 2020-11-01 00:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (291 votes). Check out past polls.

      Notices?