Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
What you seem to be wanting is a way to pass a date as a parameter, and use today only as a default. Or, pass a relative day offset, with 0 for today, -1 for yesterday and 1 for tomorrow, for example.

It might be helpful if you didn't depend on the external program date to get the dateparts. Perl is perfectly capable of handling those dateparts itself, either on its own, or via simple, standard modules, or via more elaborate CPAN modules (and that's just one example). The latter can be used for relative date calculations; on the latter you can get by calculating the times in seconds, but watch out for summer time, and thus days that are not 24 hours long. Calculating days relative to noon, on any day, is safe.

To pass around the values, you need form variables (thus a HTML form, or equivalent), and form values processing on the server side, either via GET or POST; CGI.pm, which you are already using, will do fine.

For the form values, you can use any button to set a hidden input using Javascript before submitting the form; or you can use ordinary links, where you convert the parameter values straight to an URL. (Ordinary <input name="d" value="x" type="submit"> isn't usable because of the mixup in HTML between the value in the form and the text on the button.)

I could elaborate and give examples on all approaches, but just one solution is enough so you'd better let us know which approach you're thinking on taking.


In reply to Re: changing title of a webpage dynamically by bart
in thread changing title of a webpage dynamically by tejas

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!
  • 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?
    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 romping around the Monastery: (7)
    As of 2014-08-21 12:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (134 votes), past polls