Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??


As usual, my attempts to keep a question short introduced confusion rather than clarity. So, I should explain more clearly what I am trying to do.

I have a complex data structure, a hash of hashes and arrays, that describes a set of menus for a CGI application. For each menu item, there is the text of the menu, the link text, the user documentation and the reference to the subroutine to be run when the menu entry is chosen.

A "parser" generates the appropriate menus and also handles when a menu item is chosen, as this might be a subroutine, another menu or a different URL entirely. If a subref entry exists in the hash, it calls the subroutine. WHat I needed was for the parser code to be able to get at the name of the subroutine before calling it, to allow for debug, context-sensitive help etc.

As usual, also, the superb perlmonks response produced not only rapid way of doing what I needed to do but also a thoguth-provoking discussion on other ways of doing it, doing the whole thing differently, and the meaning of perl life. Thanks to the monks.


In reply to How to de-reference a coderef? by AndyH

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?

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

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (10)
    As of 2015-04-01 21:51 GMT
    Find Nodes?
      Voting Booth?

      Who makes your decisions?

      Results (50 votes), past polls