lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV Lynx and JavaScript -Reply


From: Doug Lawson
Subject: Re: LYNX-DEV Lynx and JavaScript -Reply
Date: Sat, 16 Nov 1996 11:53:43 -0500 (EST)


On Fri, 15 Nov 1996, Filip M Gieszczykiewicz wrote:

> You (Doug Lawson) wrote:
> > On Thu, 14 Nov 1996, Filip M Gieszczykiewicz wrote:
> > > Greetings. And it's soo easy to ask users to include a valid date in a
> > > custom comment line. I use:
> > > <!-- TLJSETDATE 01/01/01 -->
> > OK, I'll bite - how are you processing this html (or proto-html) ? 
> 
> Greetings. Easy - with awk (or perl, but that doesn't work yet). I

> perl rewrite is in progress.. alas, I'm wondering why fix what ain't broke..
> so it's going slowly... ;-)

Hmmm - off thetop of my head, something like:
---------------------------------------------------------------------------
#!/usr/whatever/perl -i.bak
# use the -i switch for in place editing of each file listed 
# on the command line

@Months = ("January",
           "February",
           "March",
           "whatever..." );

($Csec,$Cmin,$Chour,$Cmday,$Cmon,$Cyear,$Cwday,$Cyday,$Cisdst) =
      localtime($CTime);

$DateString = sprintf("%s %2d %4d",$Months[$Cmon],$Cmday,(1900 + $Cyear)); 

while(<>)
{ if (/<\!-- *TLJSETDATE *--\>/o) 
    { s/TLJSETDATE/$DateString/g;}  

}
-----------------------------------------------------------------------
I'm not sure what your whole script is trying to do, but this will 
replace all instance of "TLJSETDATE" with the current date in the 
form "November 16 1996". 

Later 

Doug


;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]