[8764] in Perl-Users-Digest
Perl-Users Digest, Issue: 2383 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 22 13:27:21 1998
Date: Wed, 22 Apr 98 10:18:08 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 22 Apr 1998 Volume: 8 Number: 2383
Today's topics:
Re: IS THERE SUCH A THING AS MULTI TASKING? (Martien Verbruggen)
Java Script in CGI <wpshaf@gte.net>
Re: Java Script in CGI <karld@feklore.demon.co.uk>
Re: keys in hashs (MICHAEL PATRICK SLONE)
Re: keys in hashs (M.J.T. Guy)
Re: launching external program on W95 <jimbo@soundimages.co.uk>
Re: Lexers / tokenizers in Perl (Frank)
Re: Lexers / tokenizers in Perl <quentin@jihad.amd.com>
Re: looking for a good win32 perl editor. <david.x.corcoran@boeing.com>
Re: Losing track of STDOUT after open(FOO, "| program") <spamsux-tex@habit.com>
Re: Losing track of STDOUT after open(FOO, "| program") (Abby Franquemont)
making a window system modal in tk (David Grove)
malformed header <star@sonic.net>
Re: malformed header <sowmaster@juicepigs.com>
Re: malformed header <star@sonic.net>
Re: malformed header <dean@tbone.biol.sc.edu>
Re: malformed header <sowmaster@juicepigs.com>
Re: malformed header (Jonathan Stowe)
Re: malformed header <sneaker@earthling.net>
max length of data in sdbm record (David Grove)
Re: max length of data in sdbm record (David Grove)
Re: Message Threading <tony@cyberscape.net>
Re: Missing Last Character <rdschramm@earthlink.net>
Missing symbole __moddi3... aaarrgh <lavoie@zeus.genie.uottawa.ca>
Re: Missing symbole __moddi3... aaarrgh (Ilya Zakharevich)
module for PERL<->MS Access via ODBC (Afonso Serralha)
Re: module for PERL<->MS Access via ODBC <coryj@***NOSPAM***i-check.net>
Re: Mozilla 5.0 (WAS Re: Project question and gripe abo (robert)
Re: Mozilla 5.0 (WAS Re: Project question and gripe abo (gaj)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Apr 1998 23:38:00 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: IS THERE SUCH A THING AS MULTI TASKING?
Message-Id: <6he1so$ilh$2@comdyn.comdyn.com.au>
Please read the following information on how to choose a good subject
line:
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <6h8trv$p9k@bolivia.earthlink.net>,
"K. Watson" <cwts@earthlink.net> writes:
> I'd like to be able to display a "PLEASE WAIT" screen while an independent
> (credit card authorization) process is going on. In MVS assembler, I'd call
> it multi-tasking. Is there a PERL equivalent?
Depends on your OS. On unix you could have a look at fork().
# perldoc -f fork
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | You can't have everything, where would
Commercial Dynamics Pty. Ltd. | you put it?
NSW, Australia |
------------------------------
Date: Mon, 20 Apr 1998 18:26:28 -1000
From: "William Shaffer" <wpshaf@gte.net>
Subject: Java Script in CGI
Message-Id: <6hh738$a0t$1@gte2.gte.net>
This is a multi-part message in MIME format.
------=_NextPart_000_0020_01BD6C89.D5BEE9E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi=20
I'd like to include a java image(banner) flipper in my forum pages. =
The forum runs on a *.cgi script to generate the response pages in =
"html". Jow can I do this?
Bill
------=_NextPart_000_0020_01BD6C89.D5BEE9E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.72.2106.6"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 size=3D2>Hi </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> I'd like to =
include a java=20
image(banner) flipper in my forum pages. The forum runs on a *.cgi =
script to=20
generate the response pages in "html". Jow can I do =
this?</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000000 size=3D2> =20
Bill</FONT></DIV></BODY></HTML>
------=_NextPart_000_0020_01BD6C89.D5BEE9E0--
------------------------------
Date: Tue, 21 Apr 1998 21:46:05 +0100
From: Karl Dyson <karld@feklore.demon.co.uk>
Subject: Re: Java Script in CGI
Message-Id: <6ihp8AANWQP1EwQQ@feklore.demon.co.uk>
>Have you tried modifying the .cgi script to put the code in the HTML for
>the java applet? That's where I'd start.
Same for javascript. Just write the javascript code into the output part
of your cgi program
e.g
print "Content-type: text/html\n\n";
print <<"ending";
<html>
<head>
<script language='JavaScript'>
function doStuff() {
}
</script>
<body onLoad="doStuff()">
</body>
</html>
ending
etc. etc. etc. It's just writing a normal web page. Which is why it's
not relevent in this group.
>You may also want to try the
>comp.infosystems.www.authoring.cgi newsgroup since this is not a perl
>question.
Don't even bother posting that question to comp.infosystems.www.authorin
g.cgi. They're even stricter about off-topic posts than this one is. :)
Karl
--
Karl Dyson <karld@feklore.demon.co.uk>
"Cries and screams are music to my ears."
------------------------------
Date: 19 Apr 1998 18:54:27 GMT
From: mpslon01@msuacad.morehead-st.edu (MICHAEL PATRICK SLONE)
Subject: Re: keys in hashs
Message-Id: <6hdh93$419@infoserv.morehead-st.edu>
Andrew M. Langmead (aml@world.std.com) wrote:
> mpslon01@msuacad.morehead-st.edu (MICHAEL PATRICK SLONE) writes:
> >Transcripts of counterexamples to this counterexample, along with
> >information on OS and perl version would be appreciated.
> Since the version of perl you used seems to have a copyright
> notification from four years ago, isn't it much more likely that this
I'll petition the sysadmin to upgrade the interpreter. I knew it was old,
but I hadn't been aware of this bug...
> is a bug that has been fixed?
It seems that if the behavior is different in later versions, as your
countercounterexamples indicate, that the older version had a bug. (Either
that, or *all* of the later versions kept some new bug, which doesn't seem
as plausible, however possible it might be.)
[various countercounterexamples]
I appreciate the more recent evidence.
--
Michael Slone
------------------------------
Date: 20 Apr 1998 15:10:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: keys in hashs
Message-Id: <6hfohi$pob$1@lyra.csx.cam.ac.uk>
Bart Lateur <bart.mediamind@tornado.be> wrote:
>Could this "bug fixing" be expanded, to include this as well? (example
>adapted from the HTML:: entities module):
>
> %entity = ( 'times' => 'x' , # 'times' is a Perl keyword
> );
>
>So, could Perl's behaviour be "fixed" so that the quotes around 'times'
>may be dropped? Or has this be done already?
It's mended in the maintenance trial release perl5.004m5t1, so will
be fixed in the next maintenance release perl5.004_05.
Mike Guy
------------------------------
Date: 22 Apr 1998 13:35:37 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: launching external program on W95
Message-Id: <uvhs2vxt2.fsf@soundimages.co.uk>
Petter Bergman <petter.bergman@ehpt.com> writes:
>
> Hi,
> I am downgrading a build script from UNIX to windows. A fundamental
> problem is how to start an external program, e.g. a compiler, from a
> perl script. DOS commands work fine, but that's all. Is there a perhaps
> a DOS command for running a program?
>
Perhaps a good place to start would be the perldocs regarding system calls. As you are 'downgrading' a build script I would assume you have good experience of perl in gerneral, thus the use of backticks should spring to mind. These will allow you to execute commands, any arbitrary command, and capture it's output for further processing. You need to specify paths if the commands you request do not reside on the standard paths. To determine your standard paths type 'path' at the command prompt.
You could launch the script from a batch file which modifies the paths before invoking your perl script. To see several good examples of using batch files and perl see the contents of your perl/bin directory.
If you want to use the system function call, this will not allow you to capture the ouput of the process directly.
Additionally, you can launch a process as a file handle and thereby capture it's output to monitor the status of the process.
HTH
Jim Brewer
------------------------------
Date: 21 Apr 1998 09:07:42 +0200
From: dont_use_this_ey@hotmail.com (Frank)
Subject: Re: Lexers / tokenizers in Perl
Message-Id: <yo967k3d54x.fsf@nym.sc.philips.com>
mjd@op.net (Mark-Jason Dominus) writes:
>
> It used to be that if someone asked me I there was any kind of
> programming that Perl was not good for, I would say that it was not
> very good for writing lexers. That was because the way I was used to
> writing lexers was to process the input a character at a time with a
> state machine, and in Perl, that approach is rather slow.
>
> This, of course, does not show that Perl is bad for writing lexers.
> It just shows that this is the wrong approach to use when writing a
> lexer in Perl. I discovered over time that Perl is an *incredibly
> good* language for writing lexers, if you use the right techniques.
Hello all!
I have an ongoing background project: it is a verilog parser written
in perl. I tried to reuse as much as possible and started searching
for existing solutions. As a result I found lex & yacc source code and
additional code written in C.
My approach was (trying) to create a XSUB perl extension building an
interface to the output of lex. perl-byacc allows the perl code
generation from the yacc source file.
However I still did not manage to get all this working. The C-code
parts are making more trouble than adding benefit. So I decided to
restart from scratch at least in the lexer part. I was relieved
finding this thread at this point of time.
Do you have recommendations, tips and perhaps examples, how to set up
a project simular to my one?
with kind regards
Frank
------------------------------
Date: 21 Apr 1998 16:51:39 -0500
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: Lexers / tokenizers in Perl
Message-Id: <ximg1j6g7x0.fsf@jihad.amd.com>
>>>>> "Frank" == Frank <dont_use_this_ey@hotmail.com> writes:
Frank> I have an ongoing background project: it is a verilog
Frank> parser written in perl.
[...]
Frank-
There is verilog related perl code at
http://www.teleport.com/%7eceliac/tools.html
Here are some of the items on that page:
o The source for DC-Perl by Steve Golson
o Perl script to generate a nand tree
o Perl script to batch simulations
o Perl script to generate a verilog name referenced instance
I do not know if they will help you. Hope so!
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: Mon, 13 Apr 1998 19:37:45 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
To: James <jamesht@idt.net>
Subject: Re: looking for a good win32 perl editor.
Message-Id: <35326989.4EC1@boeing.com>
James wrote:
>
> Hello all,
>
> I'm ready to pull my hair out.
>
> Any suggestions?
>
> jamesht@idt.net
http://www.teleport.com/~gerth/CGI/Perl_Editors.html
I prefer/use vim.
------------------------------
Date: Sun, 19 Apr 1998 10:40:30 +0800
From: Austin Schutz <spamsux-tex@habit.com>
Subject: Re: Losing track of STDOUT after open(FOO, "| program") -- normal?
Message-Id: <3539641E.71F7@habit.com>
Abby Franquemont wrote:
>
> This seems to me like it should be apparent but I'm not finding an
> answer I'm sure I'm grokking to the fullest... doubtless it is all
> explained in gory detail and I've missed where (I've checked the
> perl FAQ, done a dejanews search, and looked in the man page for
> perlipc).
>
> I'm finding it to be the case that, while STDOUT is the default
> at the beginning of a script, following something like:
>
> open(FOO, "| /bin/program -flags $input") || die "No go pal $!\n";
>
> that if I do not explicitly open STDOUT again, any print statements
> for example (like to report completion of the script) do not go to
> STDOUT... instead they appear to go nowhere. (Yes, I have closed FOO)
That seems extremely odd. Perhaps you can share some code with us.
Two ways to get around this bizarreness in the mean time, assuming that
STDOUT is still open just not selected:
print STDOUT "stuff";
# -or-
select(STDOUT);
See the docs on the one-argument select function in
perldoc perlfunc.
HTH
Tex
------------------------------
Date: 20 Apr 1998 10:43:38 -0700
From: abby@ucan.foad.org (Abby Franquemont)
Subject: Re: Losing track of STDOUT after open(FOO, "| program") -- normal?
Message-Id: <6hg1ga$aen$1@ucan.foad.org>
Thanks to the two respondents to this question! The issue was indeed
buffering on STDOUT as well as my imperfect understanding of "the
currently selected filehandle."
My perl exposure till the past week or so had always been limited to
pretty much just "Hrmmm, this script I need to use for this purpose
doesn't seem to work... I'll poke the parts that seem to be generating
errors and hope I can make it work." I've been an sh scripter instead.
So, never having really sat down and said, "I'm going to write something
that will do [foo], and write it in perl," I decided to give myself a
bunch of tasks to do just that, in order to acquire the perl fluency I
have never had. There is no compelling need for the projects I decided
to take on, especially since solutions for them all exist already, I'm
just doing it in the pursuit of clue.
So... my first task was to rewrite something I know probably a little
too well -- Pnews -- and make variations and whatnot. I wanted my
goofy script to be a command-line interface to inews... something I
know quite well. The exercise for me being to make it interactive,
gather input from STDIN, generate an article based on a variety of
user-definable things, and tell the user every step of the way what
is going on, it proved to be an enjoyable exercise that really did
increase my feeling of control over perl.
That being said, I'm a little embarrassed to have written something
so silly as a perl Pnews, especcially since I'm sure that there have
already been about a kajillion others written. I wanted to deal with
calling another process from the script so I needed one with whose
syntax I'm rather intimate, and whose errors I knew well, so that I
could readily tell if I was feeding it something munged, and thus know
whether the problem was my perl or something else. I still don't have
what I'm willing to call a final copy of my crufty postfile script,
but when I do get more satisfied with it I'd be glad to have it torn
to shreds in the name of acquiring more clue. I cannot imagine the
script could really be useful to anyone though. I think I'm a little
hesitant to post it for fear someone might think it could be useful
to them. ;-)
--
Abby Franquemont Nothing cures insomnia like the realization
J. Random BOFH that it's time to get up. --Fortune program
------------------------------
Date: Mon, 20 Apr 1998 05:48:12 GMT
From: pete@dave-world.net (David Grove)
Subject: making a window system modal in tk
Message-Id: <353ae189.48205408@news.dave-world.net>
I want to create a dialog box that is system modal under Win32. In
other words, I want execution of the main program to wait until the
child windows is closed, to act upon the result of that window. I
don't want to put a lot of functionality into the child windows. How
is this accomplished?
------------------------------
Date: Sun, 19 Apr 1998 09:37:51 -0800
From: ~arthur <star@sonic.net>
Subject: malformed header
Message-Id: <353A366C.335A@sonic.net>
Good Morning,
hi i get the following because my cgi does not work-
my script is below it is from O'Reily "Learning Perl" p 188
500 - Malformed Header
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the administrator, of
http://www.sonic.net/~star/ice_cream.html, and inform them of the time
the error occurred, and anything you might have done that may have
caused the error.
Error: HTTPd: malformed header from script
/cgi-bin/star/ice_cream.pl
------
#!/usr/bin/perl -w
#cgi-bin/ice_cream: program to answer and generate ice cream
#favorite flavor form (version 3)
use cgi qw(:standard);
my $favorite = param("flavor");
print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream");
if ($favorite) {
print p("Your favorite flavor is $favorite.");
} else {
print hr, start form;
print p("Please select a flavor: ", textfield ("flavor", "mint"));
print end_form, hr;
}
-------
this is the line that causes the
problem.
print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream");
Thanks for the help.
~arthur
------------------------------
Date: Sun, 19 Apr 1998 13:16:02 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: star@sonic.net
Subject: Re: malformed header
Message-Id: <353A3152.6544@juicepigs.com>
~arthur wrote:
> #!/usr/bin/perl -w
> #cgi-bin/ice_cream: program to answer and generate ice cream
> #favorite flavor form (version 3)
> use cgi qw(:standard);
> my $favorite = param("flavor");
> print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream");
> if ($favorite) {
> print p("Your favorite flavor is $favorite.");
> } else {
> print hr, start form;
> print p("Please select a flavor: ", textfield ("flavor", "mint"));
> print end_form, hr;
> }
You ready to bang your head off the wall? It looks simple to me.
The module is CGI.pm not cgi.pm. Perl is case sensitive. Capitalize cgi
in your use statement.
HTH
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Sun, 19 Apr 1998 10:54:20 -0800
From: ~arthur <star@sonic.net>
Subject: Re: malformed header
Message-Id: <353A485B.3792@sonic.net>
Thanks Bob,
I think i am almost there. Now I get just the header does anyone know
why?
Hopefully thankful,
~arthur
> The module is CGI.pm not cgi.pm. Perl is case sensitive. Capitalize cgi
> in your use statement.
>
> HTH
> --
> Bob Trieger | Titanic: big boat, bigger
> sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: 19 Apr 1998 14:18:15 -0400
From: Dean Pentcheff <dean@tbone.biol.sc.edu>
Subject: Re: malformed header
Message-Id: <87af9h7k0o.fsf@tbone.biol.sc.edu>
Bob Trieger <sowmaster@juicepigs.com> writes:
> ~arthur wrote:
> > #!/usr/bin/perl -w
> > #cgi-bin/ice_cream: program to answer and generate ice cream
> > #favorite flavor form (version 3)
> > use cgi qw(:standard);
...
>
> You ready to bang your head off the wall? It looks simple to me.
>
> The module is CGI.pm not cgi.pm. Perl is case sensitive. Capitalize cgi
> in your use statement.
>
> HTH
No doubt it will help. More helpful would be advice to check the WWW
server error logs (where output from errors in CGI programs gets
shunted). Had ~arthur done that, (s)he would probably have seen an
error message to the effect that "Module cgi is not found".
The specific answer is helpful; even more helpful is a general pointer
to sources of future information. I'd prefer to give ~arthur a good
tool than keep seeing easily answered questions from him.
(Why the pompous attitude from me? See Bob Trieger's comments
regarding Abigail's postings in recent days.)
-Dean
--
N. Dean Pentcheff <pentcheff@acm.org>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)
------------------------------
Date: Sun, 19 Apr 1998 14:35:35 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: Dean Pentcheff <dean@tbone.biol.sc.edu>
Subject: Re: malformed header
Message-Id: <353A43F7.572E@juicepigs.com>
Dean Pentcheff wrote:
> (Why the pompous attitude from me? See Bob Trieger's comments
> regarding Abigail's postings in recent days.)
Please feel free to cut and paste said posts!
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Sun, 19 Apr 1998 21:58:58 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: malformed header
Message-Id: <353a6875.5224246@news.btinternet.com>
On Sun, 19 Apr 1998 09:37:51 -0800, ~arthur <star@sonic.net> wrote:
>Good Morning,
>
>hi i get the following because my cgi does not work-
Eh,oh
>my script is below it is from O'Reily "Learning Perl" p 188
>
>500 - Malformed Header
>
Nasty
> The server encountered an internal error or misconfiguration and was
>unable to complete your request.
>
Perl question right ?
> Please contact the administrator, of
>http://www.sonic.net/~star/ice_cream.html, and inform them of the time
>the error occurred, and anything you might have done that may have
>caused the error.
>
Hmm
> Error: HTTPd: malformed header from script
>/cgi-bin/star/ice_cream.pl
>------
Here we go
>#!/usr/bin/perl -w
>#cgi-bin/ice_cream: program to answer and generate ice cream
>#favorite flavor form (version 3)
>use cgi qw(:standard);
>my $favorite = param("flavor");
>print header, start_html("Hello Ice Cream"), h1("Hello Ice Cream");
>if ($favorite) {
> print p("Your favorite flavor is $favorite.");
>} else {
> print hr, start form;
> print p("Please select a flavor: ", textfield ("flavor", "mint"));
> print end_form, hr;
>}
>
__END__
#!/develop/bin/perl -w
#cgi-bin/ice_cream: program to answer and generate ice cream
#favorite flavor form (version 3)
use CGI;
my $thing = new CGI;
my $favorite = $thing->param("flavor");
print $thing->header;
print $thing->start_html("Hello Ice Cream");,
<etc, etc>
You might want to use this in your script as came up in an earlier
thread:
On Sun, 19 Apr 1998 12:24:58 GMT, Gellyfish@btinternet.com (Jonathan
Stowe) wrote:
>use the -w switch with perl to give you debugging help (you may have
>to do something with the server to achieve this - but thats out of
>scope) and use this code from Randal Schwartz (thanks to
>tim@maroney.org who reminded us ) at the top of your code to get some
>diagnostic output to your browser:
>
>## death handler, presumes no output yet
>$SIG{'__DIE__'} = $SIG{'__WARN__'} = sub {
> my $error = shift;
> chomp $error;
> $error =~ s/[<&>]/"&#".ord($&).";"/ge; # entity escape;
> print "Content-type: text/html\n\n[$error]\n";
> exit 0;
>};
>
And thus amended by Larry Rosler for simplicity (less newbie fear
perhaps) - (hey I can understand it so its going to work! )
## death handler, presumes no output yet
$SIG{'__DIE__'} = $SIG{'__WARN__'} = sub {
print "Content-type: text/plain\n\n", shift;
exit 0;
};
Ta Lazza.
/.J\
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm
------------------------------
Date: Sun, 19 Apr 1998 23:02:11 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: malformed header
Message-Id: <353A80D8.8AAE6D5B@earthling.net>
This is a multi-part message in MIME format.
--------------AB8F6164223EA07D0C8A42FD
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
~arthur wrote:
> use cgi qw(:standard);
>
use CGI qw(:all); # Perl is case sensitive. Oh, and import 'all' of the
CGI stuff.
> print hr, start form;
The above is wrong, see below for why.
I think print is looking at start form as some
special case perl command and can't find it.
when I ran your code I got -
"Can't locate method 'start' in line..."
However, after I corrected the
use CGI, etc, I got the below attached:
PS - Since I wrote this much I will
also say that the line where
print hr, start form; is, should read:
print hr, start_form;
Note the UnderBar in start_form :-)
HTH,
Sneex
--------------AB8F6164223EA07D0C8A42FD
Content-Type: text/html; charset=us-ascii; name="output"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="output"
Content-Base: "file:/sneex/output"
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML><HEAD><TITLE>Hello Ice Cream</TITLE>
</HEAD><BODY><H1>Hello Ice Cream</H1>
--------------AB8F6164223EA07D0C8A42FD--
------------------------------
Date: Mon, 20 Apr 1998 06:10:19 GMT
From: pete@dave-world.net (David Grove)
Subject: max length of data in sdbm record
Message-Id: <353ae66d.49457061@news.dave-world.net>
What is the maximum length of data in an sdbm record, key, and value?
------------------------------
Date: Mon, 20 Apr 1998 18:14:16 GMT
From: pete@dave-world.net (David Grove)
Subject: Re: max length of data in sdbm record
Message-Id: <353b8efa.3262001@news.dave-world.net>
>>What is the maximum length of data in an sdbm record, key, and value?
>
>There is a table of the features of the various supported DBM
>implementations in the "AnyDBM_File" module. Use the command
>
> perldoc AnyDBM_File
>
>to view it.
Yes, I know. It does not contain the information I'm looking for. If
it did I would not have asked here.
------------------------------
Date: Mon, 20 Apr 1998 19:52:22 +0100
From: "Tony Kenny" <tony@cyberscape.net>
Subject: Re: Message Threading
Message-Id: <6hg5hs$nf0$1@svr-c-01.core.theplanet.net>
Thanks,
I just managed to work it out a few hours after my posting.
My thanks to everyone on #perl, in particular kjj, amagosa, crimethnk, er,
and who ever the others were.
My solution in the end was in the code below. The idea being that the whole
group can be stored in a single DB File using MLDBM. I will be changing
some bits of it, in particular I will be using references to other messages
instead of simple number (IDs for other messages in the thread).
I would be very happy to see what people make of this and suggestions will
be looked at very carefully.
ama, I changed the TLAs as you suggested :)
#!/usr/bin/perl
$| =1;
print "Contetn-type: text/html\n\n";
$Messages{1} = {"Subject","Message 1",
"Next",[],
"Prev",[]};
$Messages{2} = {"Subject","Message 2",
"Next",[3],
"Prev",[]};
$Messages{3} = {"Subject","Message 2b",
"Next",[4,6,7,8],
"Prev",[2]};
$Messages{4} = {"Subject","Reply 2b",
"Next",[],
"Prev",[3]};
$Messages{5} = {"Subject","Message 3",
"Next",[],
"Prev",[]};
$Messages{6} = {"Subject","Reply2b",
"Next",[14],
"Prev",[2]};
$Messages{7} = {"Subject","Reply 2b",
"Next",[],
"Prev",[3]};
$Messages{8} = {"Subject","Reply 2b",
"Next",[9],
"Prev",[3]};
$Messages{9} = {"Subject", "Reply 2e",
"Next",[13],
"Prev",[8]};
$Messages{10} = {"Subject", "Message 10",
"Next",[],
"Prev",[]};
$Messages{11} = {"Subject", "Message 11",
"Next",[],
"Prev",[]};
$Messages{12} = {"Subject", "Message 12",
"Next",[],
"Prev",[]};
$Messages{13} = {"Subject","Reply2e1",
"Next",[],
"Prev",[9]};
$Messages{14} = {"Subject","ReplyNEXT",
"Next",[],
"Prev",[6]};
#foreach $N (@{$Messages{"2"}{"Next"}})
#{
# print qq! $N \n!;
#}
##### Start Displaying Heads.
$Count = 1;
foreach $ID (sort keys %Messages)
{
next if ( @{$Messages{"$ID"}{"Prev"}});
print qq~ $Messages{"$ID"}{"Subject"} \n~;
foreach $NextThread (@{$Messages{"$ID"}{"Next"}})
{
&NextThread("$NextThread");
}
}
# NextThread("$MessageID");
sub NextThread
{
$Count ++;
local ( $Next ) = @_;
local ( $NextThread );
print " " x $Count;
print qq~ $Messages{"$Next"}{"Subject"} \n~;
foreach $NextThread (@{$Messages{"$Next"}{"Next"}})
{
&NextThread("$NextThread");
}
$Count --;
}
#END
Roger So wrote in message <6hfrho$je0$1@nswpull.telstra.net>...
>Tony Kenny wrote in message <6hd6b1$lhb$1@svr-c-02.core.theplanet.net>...
>>I am trying to create a web based discussion forum preferably using DBM
>>files.
>
>
>I'm trying to do this as well, but using plain text files for everything.
>But I guess the file format shouldn't affect the algorithm...
>
>>My problem is that I am trying to work out how to thread the messages. I
>>understand this is a tricky concept and have search the web and all my
>books
>>trying to find out how to do it.
>>
>>Does anyone know of where i can find some information on this so that i
may
>>learn how it is done. Or, can anyone help me in any way, pointer to the
>>right way of doing it would be quite helpful.
>
>
>Take a look at this: http://spacehunt.ml.org/~rogerso/cgi-bin/test3.pl Is
>this what you're trying to do?
>
>This is how it works: each message in the forum contains a "FollowUp"
field,
>which is a list of message IDs that is a direct reply to that message
>*only*. When you want to display a threaded list of messages, start at the
>thread's first message, and:
>1) Print "<ul> $the-message-title \n";
>2) Look at the "FollowUp" field;
>3) If not empty, foreach (@FollowUp) { repeat step 1; }
>4) Print "</ul>\n";
>... or something similar.
>
>I've started learning Perl only 4 days ago, so the above is probably not
the
>proper way to do it, inefficient, or even completely wrong. :)
>
>Cheers,
>
>Roger So rogerso@spacehunt.ml.org
>
------------------------------
Date: Sun, 19 Apr 1998 18:49:59 -0400
From: <rdschramm@earthlink.net>
Subject: Re: Missing Last Character
Message-Id: <6hdv6c$ib4@chile.earthlink.net>
The chop function lops off the last character of a line, whether it is a
newline charator or not. My guess is that your input file does not have a
newline charactor on the last line, and chop is therefore taking off the
"2".
Try using the chomp function, which is a "safer" function like chop, except
it only lops off newline charactors at the end of a line. If there is not a
newline charactor, it won't do anything.
>section header, and any other line as a credit. The problem is that
>the script always misses the last character from the file:
------------------------------
Date: 20 Apr 1998 18:43:44 -0400
From: Philippe Lavoie <lavoie@zeus.genie.uottawa.ca>
Subject: Missing symbole __moddi3... aaarrgh
Message-Id: <y6lnt0t8pr.fsf@zeus.genie.uottawa.ca>
This is very frustrating...
I get this error
Can't load '/home/yoho2/lavoie/lib/perl5/site_perl/sun4-solaris/auto/Mysql/Mysql.so' for module Mysql: ld.so.1: /home/yoho2/lavoie/bin/perl: fatal: relocation error: symbol not found: __moddi3: referenced in /home/yoho2/lavoie/lib/perl5/site_perl/sun4-solaris/auto/Mysql/Mysql.so at /home/yoho2/lavoie/lib/perl5/sun4-solaris/5.00404/DynaLoader.pm line 166.
My gut feeling tells me that the error is caused by a missing
dependancy somewhere. I checked the code and I couldn't find anyplace
were a call to __moddi3 is made.
Can anyone help me ?
Thanks
Phil
PS Please send a copy of the reply in e-mail. Thanks
------------------------------
Date: 21 Apr 1998 01:30:28 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Missing symbole __moddi3... aaarrgh
Message-Id: <6hgsrk$f6f$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Philippe Lavoie
<lavoie@zeus.genie.uottawa.ca>],
who wrote in article <y6lnt0t8pr.fsf@zeus.genie.uottawa.ca>:
>
> This is very frustrating...
>
> I get this error
>
> Can't load
> '/home/yoho2/lavoie/lib/perl5/site_perl/sun4-solaris/auto/Mysql/Mysql.so'
> for module Mysql: ld.so.1: /home/yoho2/lavoie/bin/perl: fatal:
> relocation error: symbol not found: __moddi3: referenced in
Add to LIBS in MakeMaker:
-L/you/gcc/lib/dir -lgcc
Ilya
------------------------------
Date: 19 Apr 1998 14:39:17 GMT
From: l38041@alfa.ist.utl.pt (Afonso Serralha)
Subject: module for PERL<->MS Access via ODBC
Message-Id: <6hd2al$nah$1@ci.ist.utl.pt>
Hello,
I'm involved in a project where I need to have interaction between Perl scipts a
nd MS Access via ODBC. I have some experience in Perl but none concerning the da
tabase interaction world. I'd appreciate some help concerning this.
I was told to use MySQL, but this is a database system itself, isn't it? So it w
ould not solve the PERL<->MS Access interaction problem...
Thanks in advance,
Afonso Serralha (IST-Technical University of Lisbon, Portugal)
P.S. Reply also to my e-mail, please.
------------------------------
Date: Sun, 19 Apr 1998 17:26:19 -0700
From: "Cory Johnson" <coryj@***NOSPAM***i-check.net>
Subject: Re: module for PERL<->MS Access via ODBC
Message-Id: <6he4nq$do9@dfw-ixnews12.ix.netcom.com>
I just found out how to do this myself. A good reference is at
http://www.roth.net/odbc/
Afonso Serralha wrote in message <6hd2al$nah$1@ci.ist.utl.pt>...
>Hello,
>
>I'm involved in a project where I need to have interaction between Perl
scipts a
>nd MS Access via ODBC. I have some experience in Perl but none concerning
the da
>tabase interaction world. I'd appreciate some help concerning this.
>
>I was told to use MySQL, but this is a database system itself, isn't it? So
it w
>ould not solve the PERL<->MS Access interaction problem...
>
>Thanks in advance,
>Afonso Serralha (IST-Technical University of Lisbon, Portugal)
>
>P.S. Reply also to my e-mail, please.
------------------------------
Date: 20 Apr 1998 14:43:27 +0200
From: robert@il.fontys.nl (robert)
Subject: Re: Mozilla 5.0 (WAS Re: Project question and gripe about (Re: Snobby news group))
Message-Id: <6hfftf$87c@bsd1.ilse.net>
sneaker@mediaone.net:
>> You don't have motif do you ? You need it to compile 'mozilla'.
>> The source released on the first day compiles out the tar ball without
>> modification on Solaris with CDE as it includes motif includes and libs.
>No, I'm RedHat 5.0 (Hurricane)
>But I now have a place to start :-)
If you don't want to use Motif (since, like, it costs money), you could
check out http://www.troll.no/ for a Qt (a graphical library for X)
version of Mozilla 5. It compiles and runs on my (quite moderate) machine
(although rather buggy, but thats seems to be a Mozilla problem rather
than a Qt problem :).
robert
------------------------------
Date: Tue, 21 Apr 1998 23:04:28 GMT
From: gjandl@rf.mnschoolbiz.com (gaj)
Subject: Re: Mozilla 5.0 (WAS Re: Project question and gripe about (Re: Snobby news group))
Message-Id: <353d253c.21116398@news.spacestar.net>
On Sun, 19 Apr 1998 03:28:27 GMT, Bill 'Sneex' Jones
<sneaker@earthling.net> wrote:
>Jason Gloudon wrote:
>
>> >I cannot get it to compile. I have the Unix version.
>
>No, I'm RedHat 5.0 (Hurricane)
>But I now have a place to start :-)
Grab the latest version of Lestif from the Hungry Programmers
(www.hungry.com). Mozilla will compile with it, tho it's a bit shakey!
(As if it isn't anyway! ;) Such is life with pre-alpha code running
against alpha libraries (well...more like beta level I guess)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2383
**************************************