Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Inserting Current time and date into an HTML file.

by balajinagaraju (Sexton)
on Nov 23, 2012 at 06:20 UTC ( [id://1005215]=perlquestion: print w/replies, xml ) Need Help??

balajinagaraju has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a task to perform and i am seeking some advice, we are building a java source using an ant script and it generates the javadoc for the complete source.Now we want to insert the build date and time inside the html files of the javadoc and we want to use perl script and insert the date and time into html files. Is there a better way to do this? or how exactly i can accomplish this task. Please guide.

Replies are listed 'Best First'.
Re: Inserting Current time and date into an HTML file.
by roboticus (Chancellor) on Nov 23, 2012 at 15:05 UTC

    balajinagaraju:

    As much as I like perl, why insert yet another tool into the mix? Is something wrong with doing it in ant?

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      As much as I like perl, why insert yet another tool into the mix?

      Because he's fishing for answers, doesn't care how it happens

        Dear Anonymous Monk , I consider this as a great forum for learning, and i am here to learn things as i am new to things. I don't want to fish for answers instead i want to know how things are done. Please if you can't guide anyone , don't discourage them. I appreciate your valuable time put in to provide your comments.

Re: Inserting Current time and date into an HTML file.
by Anonymous Monk on Nov 23, 2012 at 06:49 UTC
    Seriously?

    perl -CSDL -MARGV::readonly -pi.orig -e "use constant JID => scalar gmtime; s{\Q<!--junkid-->\E}{JID()}ge; " bunch of files to stamp

      Hi , Thanks for your response, can you please elaborate on what exactly the code is doing?.

        Hi , Thanks for your response, can you please elaborate on what exactly the code is doing?.

        What do you think it is doing?

        I think the code does nothing. It similar to this code which might do something Write to existing file with character insert

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1005215]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-03-28 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found