Perl

Moderators: Jonathan
Number of threads: 1236
Number of posts: 3605

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Searching for a simple method... Posted by FluidMotion on 23 Aug 2003 at 12:33 PM
Hello, I have recently gotten the responsibility of creating my kung fu kwoons website. Given I am a C++ programmer, I have no interest in PERL, as you probably have the oppisite opinion. I am searching for an apparently simple method to take the characters in a text file, and put it into the html document.

I was using javascript, but many dependancies and abiguities between shtml, javascript and a piece of java I am using have forced me to use CGI. I would be very pleased if you could help me out. Thanks!
Report
Re: Searching for a simple method... Posted by WaltP on 23 Aug 2003 at 7:49 PM
: Hello, I have recently gotten the responsibility of creating my kung fu kwoons website. Given I am a C++ programmer, I have no interest in PERL, as you probably have the oppisite opinion. I am searching for an apparently simple method to take the characters in a text file, and put it into the html document.
:
: I was using javascript, but many dependancies and abiguities between shtml, javascript and a piece of java I am using have forced me to use CGI. I would be very pleased if you could help me out. Thanks!

What I did in this case is:
1) create a template that makes each page identical in look with no content
2) create text files with the content for each page
3) write a C++ program to merge the content into the template and output each HTML page
4) upload to the site

----------------
Walt


Report
Re: Searching for a simple method... Posted by Jonathan on 24 Aug 2003 at 9:14 AM
: Hello, I have recently gotten the responsibility of creating my kung
: fu kwoons website. Given I am a C++ programmer, I have no interest in
: PERL, as you probably have the oppisite opinion. I am searching for
: an apparently simple method to take the characters in a text file,
: and put it into the html document.
:
: I was using javascript, but many dependancies and abiguities between
: shtml, javascript and a piece of java I am using have forced me to
: use CGI. I would be very pleased if you could help me out. Thanks!

OK, the following script opens a text file and puts it amongst some HTML code.

#!/usr/bin/perl

#Read in file.
open my $fh, "< path/to/file.txt";
my $file = join('', <$fh>);
close $fh;

#Print HTTP header.
print "Content-type: text/html\n\n";

#Print page file contents in it.
print qq{
<html>
<b>File Contents</b><br>
$file
</html>
};


Hope this helps,

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");




 

Recent Jobs