--- Peter Jay Salzman <[EMAIL PROTECTED]> wrote:
<snip>

> <HTML>
> <HEAD><TITLE>Bulletin Board</TITLE></HEAD>
> <BODY>
> <PRE>
> `cat /www/pcgm/bulletins`
> </PRE>
> </BODY>
> </HTML>
> 
> how can i do this?  i *think* php can do this, but i
<snip>

Hi Pete,

Don't know PHP but Perl could do it:

# -----
#!/perl/bin/perl.exe -w
use strict;
use File::Slurp;

my $file = 'template.txt';
my $mid = '
   <PRE>
   `cat /www/pcgm/bulletins`
   </PRE>
';

my $template = read_file( $file );
$template =~ s/<body>.*<\/body>/<body>$mid<\/body>/is;

print $template;
# -----

Tested on Win98.  The $mid could be indented or not.

---
Jim

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com
_______________________________________________
vox-tech mailing list
[EMAIL PROTECTED]
http://lists.lugod.org/mailman/listinfo/vox-tech

Reply via email to