Using perl for THIS is silly.  sed can do everything you'er doing with perl.

-----
Eric F Crist



On Jul 14, 2012, at 22:03:01, Yaron wrote:

> I use perl GCI for this kind of stuff all the time. Basically make your html file (lets call it file.html) and put a marker in there, like %%MD5SUM%% or something. Then your CGI does this:
> 
> 	#!/usr/bin/perl
> 	$|=1;
> 	$file="file.html";
> 	chomp($md5=`md5sum  direct.tar.bz2`);
> 
> 	open(F, $file);
> 	while(<F>) {
> 		s/%%MD5SUM%%/$md5/ if (/%%MD5SUM%%/);
> 		print;
> 	}
> 
> 	close (F);
> 	exit(0);
> 
> That's extremely simplified with no full paths or strict mode or error checking, but you get the idea.
> 
> On Sat, 14 Jul 2012, Brian Wood wrote:
> 
>> I'm wondering how to automate something further.  Currently I
>> use the following commands (in a script) when I publish a
>> new version of the software.
>> md5sum  direct.tar.bz2 | tee md5checksum
>> cat md5checksum | xclip -sel clip
>> After that I edit an html file by hand and paste the new
>> checksum into the file.  Once in a while I forget to do that
>> step.  So I'd like to figure out how to improve the process. 
>> What do you suggest?  Thanks in advance.
>> Shalom,
>> Brian Wood
>> Ebenezer Enterprises
>> http://webEbenezer.net
>> 
> 
> 
> -Yaron
> 
> --_______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.mn-linux.org/pipermail/tclug-list/attachments/20120714/7d9b6659/attachment.pgp>