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

comment on

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

I'm developing a module CGI::PathRequest (seemed like the best name). It's an object that encapsulates various queries to a resource being accessible in a cgi environment. Usualyl a http accessible file.

You optionally initiate it by passing it a relative path.. And as you query it, it gives you info like relative path, absolute path, prettied up filename, is_text, is_dir, is_image, get an excerpt (if a text file) some other things that are really useful to me when I code CGI.

I want to give a coder using this module a lot of freedom. I want it to be intuitive.

How should someone query the instance for an absolute path? The more conservative way is: $object->get_absolute_path , but it could be more intuitive for someone to ask for $file->abs_path - so I have both. Someone should not *have* to read the documentation to use a module that serves such basic data. Is *one* way to pitch this.

It doesn't *need* to have that many synonims. I remember reading somewhere that a good application is liberal about what it accepts and conservative about what it outputs. I am trying to be liberal about what it accepts- about how you can ask it questions.

Yes, they can look at the documentation (which i wrote first).. But I want it to be intuitive. I almost would like to be able to ask $object->get_me_the_absolute_path and let the thing resolve by itself what the heck i want ( i know there's a module for that.. was it Sam Treggar?).

In reply to Re^2: what's a proper way to code method synonyms by leocharre
in thread what's a proper way to code method synonyms by leocharre

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?

    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 examining the Monastery: (5)
    As of 2020-11-25 03:21 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found