[17043] in Perl-Users-Digest
Perl-Users Digest, Issue: 4455 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 28 03:05:28 2000
Date: Thu, 28 Sep 2000 00:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <970124708-v9-i4455@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 28 Sep 2000 Volume: 9 Number: 4455
Today's topics:
Re: [Q]Perl CGI on Netscape enterpirse server 3.0 faile <gokkog@yahoo.com>
Re: accessing global variables in another perl module <jasoniversen@my-deja.com>
Re: accessing global variables in another perl module <elephant@squirrelgroup.com>
animation and annotation for GIF images under perl. <vlad@sas.nsk.su>
ANNOUNCE: Lingua::EN::VerbTense <jdb@wcoil.com>
Re: ASAP: How $SCALAR = $LIST (Craig Berry)
flock <mikecook@cigarpool.com>
Re: flock <godzilla@stomp.stomp.tokyo>
Re: need help with LWP/https/proxy <dale@emmons.dontspamme.com>
Re: Newbie windows perl question <dale@emmons.dontspamme.com>
Re: OT: Newbie windows perl question <merlinjb@pyramid.net>
Re: Perl on Windows <elephant@squirrelgroup.com>
Re: Shortest code for Fibonacci? <rick.delaney@home.com>
Re: Suggestion for Web interface to DBI? <philipg@atl.mediaone.net>
Re: What does this do?! (Gwyn Judd)
Re: What does this do?! (Gwyn Judd)
Re: why "Prototype mismatch"? <anmcguire@ce.mediaone.net>
Re: why "Prototype mismatch"? <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 Sep 2000 14:38:59 +0800
From: "Wenjie Zhao" <gokkog@yahoo.com>
Subject: Re: [Q]Perl CGI on Netscape enterpirse server 3.0 failed
Message-Id: <8quouo$gnd$1@bt02e2.god.bel.alcatel.be>
"amonotod" <amonotod@netscape.net> wrote in message
news:8qssss$r32$1@nnrp1.deja.com...
> In article <8qsfta$n59$1@bt02e2.god.bel.alcatel.be>,
> "Wenjie Zhao" <gokkog@yahoo.com> wrote:
> > Hello,
> >
> > We have an application with many cgi scripts written in Perl.
> > We have tested it under Apache web server.
> > Now the targeted platform changed to Netscape Enterprise
> > Server 3.0, Some strange thing happened:
>
> It doesn't matter what type of CGI you're using, this is not
> necessarily a Perl question. You should take this question to another
> newsgroup, preferably either a CGI or webserver group. However, since I
> am familiar with, and indeed prefer, NES, I'll work with you on this...
>
> >
> > Some cgi scripts work fine while others failed. the Logs
> > say that "cannot print a valid header". We thought it's related
> > to our own ParamConfig.pm used in the cgi scripts. After
> > renaming this module, some other disturbing words tell
> > redefined of New ...Exporter...
> >
> > Does somebody have a clue for the problem?
> >
> > P.S. I checked Netscape's web site, it says this (cannot print
> > a valid header) may be due to dependencies on external
> > libraries, I tried their solution(absolute lib path), but it won't
> work.
> >
>
> NES is _very_ particular about having a CGI return something, anything,
> it doesn't care what, as long as it gets at least two newlines per
> script. Most likely, you don't have all the libraries which your
> scripts are dependent on. For each script that won't run through the
> webserver, try running it from the command prompt, on the system which
> houses the web server, preferably as the webserver account.
>
> Also, try this: For each script that won't run, replace it with this:
>
> #!perl -w
> # Hello world
> print "Content: Type=text/html\n\n";
> print "<html>\n<body>\n";
> print "<h2> Hello World\!</h2>\n";
> print "</body>\n</html>\n";
>
> That will at least tell if the server is able to find the script.
> Really, though, I think it is a matter of missing libraries...
>
> HTH,
> amonotod
>
> --
> `\|||/ amonotod@
> (@@) netscape.net
> ooO_(_)_Ooo________________________________
> _____|_____|_____|_____|_____|_____|_____|_____|
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Thanks for your helps! Now, it's working now. It seems Apache can
tolerate some warnings issued by Perl scripts while NES doesn't.
But I still have questions ;-).
=>How to resolve the Perl module naming conflicts in an elegant maner?
Or is it possible to have the same customer Perl module name as in a
standard perl module?
=>Still naming conflicts: How could I use two or more Perl modules with one
uniform module methods(use Exporter(); use @ISA= qw(Exporter);...)?
------------------------------
Date: Thu, 28 Sep 2000 04:22:19 GMT
From: jason iversen <jasoniversen@my-deja.com>
Subject: Re: accessing global variables in another perl module
Message-Id: <8quh1o$84i$1@nnrp1.deja.com>
i feared that it wouldnt be possible to have a global variable defined
in A::main() and avaliable in B::mysub() without passing it as a
parameter.
the reason why i want to do it this way if because i have many many subs
wanting the variable in many different modules. i didn't want to pass
around to EVERY single little sub.
in real life, i have
util::debugmessage() which uses a passed message and a verbosity level.
many differnt routines call debugmessage() and i dont want to pass the
debug level every time. i just want to define in main() and be done..
the equivalent of what i want to in C is..
file A
....
int myglobal;
void main()
{
b()
}
.....
file B
....
extern int myglobal;
void b()
{
//we can see and modify myglobal here
}
is this not possible in PERL?
In article <MPG.143d39cfa7b3279d9897d2@localhost>,
jason <elephant@squirrelgroup.com> wrote:
> jason iversen wrote ..
> >i am having trouble with accessing a global var
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 28 Sep 2000 16:05:58 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: accessing global variables in another perl module
Message-Id: <MPG.143d8ad3ce45a0b29897da@localhost>
jason iversen wrote ..
>i feared that it wouldnt be possible to have a global variable defined
>in A::main() and avaliable in B::mysub() without passing it as a
>parameter.
>
>the reason why i want to do it this way if because i have many many subs
>wanting the variable in many different modules. i didn't want to pass
>around to EVERY single little sub.
>
>
>in real life, i have
>
>util::debugmessage() which uses a passed message and a verbosity level.
>many differnt routines call debugmessage() and i dont want to pass the
>debug level every time. i just want to define in main() and be done..
>
>
>
>the equivalent of what i want to in C is..
>
>file A
>....
>
>int myglobal;
>void main()
>{
>b()
>}
>
>
>.....
>file B
>....
>extern int myglobal;
>void b()
>{
>//we can see and modify myglobal here
>}
>
>
>
>is this not possible in PERL?
yes that's possible .. it wasn't really clear what you were trying to do
originally
file A.pl
#!/usr/bin/perl -w
use strict;
use Blah;
$::v_level = 7;
print Blah::debug_message(), "\n";
__END__
file Blah.pm (note you can't actually use B.pm without adjusting @INC
because that already exists in the standard Perl distribution)
package Blah;
sub debug_message
{
return 'Oooh, bad message' if $::v_level > 6;
return 'Not so bad message' if $::v_level > 4;
return 'Pretty damn friendly' if $::v_level > 2;
return 'Why bother me ?';
}
1;
__END__
of course this will still require a lot of code changes throughout all
those 'many many' subs .. but it's certainly closer to your C example
for reference check out the perlmod and perlsub sections of the
documentation
perldoc perlmod
perldoc perlsub
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 28 Sep 2000 11:13:52 +0700
From: "vladimir y. plotnikov" <vlad@sas.nsk.su>
Subject: animation and annotation for GIF images under perl.
Message-Id: <970114069.617379@h2o.riss-telecom.ru>
Hello All!
I have problem with subject.
I need in script, working under perl and Apache on unix. (linux.freebsd)
this script must do next:
1.pickup image
2.write lot of texts over image with animation (GIF) effects.
3.display it under apache.
I can find for this only Image::Magick perl libary (PerlMagick) and this
one
is VERY, VERY slowly on place text phase (I use freetype libary for support
ttf files). (about 10-15 secound per animated image with 20 layers)
May be anybody know another libary for this, but faster?
NB: please, replay by email or crosspost replay to my email address.
thanks in advise!
--
vladimir y. plotnikov, mailto:vlad@sas.nsk.su
Novosibirsk, Siberia Russia
ICQ UIN: 24270826, phone +7-383-239-7917, phone/fax +7-383-232-2143
------------------------------
Date: 28 Sep 2000 06:52:42 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: ANNOUNCE: Lingua::EN::VerbTense
Message-Id: <8quprq$us1$0@206.230.71.53>
Greetings all,
Announcing the release of:
Lingua::EN::VerbTense, v3.00
Derived from demo script by Chris Meyer.
Recomended download URL:
http://www.josiah.countystart.com/modules/get.pl?verb_tense:clp.misc
This file has also entered the CPAN as:
file: $CPAN/authors/id/J/JB/JBRYAN/Lingua-EN-VerbTense-3.00.zip
size: 14479 bytes
md5: e9f8738d402b73dd61509a3c3ef7239f
**NAME:
Linga::EN::VerbTense - Parses verb structures into modal, tense, &
infinitive.
** SYNOPSIS:
use Lingua::EN::VerbTense;
my $string = 'I am going home now.'
my ($modality, $tense, $inf) = verb_tense($string);
# Gives:
# $modality='None', $tense='Present Progressive', $inf='go'
$string = 'He really did eat the cookie.';
($modality, $tense, $inf) = verb_tense($string);
# Gives:
# $modality='Affirmative', $tense='Present', $inf='eat'
$string = 'How could she have done that???';
($modality, $tense, $inf) = verb_tense($string);
# Gives:
# $modality='Subjective Ability', $tense='Perfect', $inf='do'
** DESCRIPTION:
This is a simple Perl module designed to parse english verb structures
using a finite state machine into the verb tense and infinitive, as well
as the type of infinitive in the structure. This was originally written
by Chris Meyer <chris@mytechs.com>. Josiah Byran <jdb@wcoil.com> added
multiple tweaks and twists, POD docs, and CPAN packaging.
Cheers!
--
Josiah Bryan <jdb@wcoil.com>
------------------------------
Date: Thu, 28 Sep 2000 05:23:52 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ASAP: How $SCALAR = $LIST
Message-Id: <st5lf86q9i1f1f@corp.supernews.com>
Abigail (abigail@foad.org) wrote:
: Don Vaillancourt (donv@webimpact.com) wrote on MMDLXXXIV September
: MCMXCIII in <URL:news:39D259DC.7DE580A8@webimpact.com>:
: ~~ How to I get the number of elements in a list that is only accessible
: ~~ through a reference from a scalar.
:
: $#{EXPRESSION YIELDING A REFERENCE TO AN ARRAY}
Ain't that gonna be the index of the last element, rather than the number
of elements? Abigail, have you been setting $[ to 1 again? :)
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Quidquid latine dictum sit, altum viditur."
|
------------------------------
Date: Wed, 27 Sep 2000 21:41:11 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: flock
Message-Id: <SZzA5.1286$q9.352919@news.uswest.net>
Hi folks,
I have read everything I can on fcntl & flock am still a bit unsure of
the best way to manage locking/unlocking. Below is a piece of code that I
think is right, but I have been told more than once (but can't find any info
to back it up), you shouldn't unlock before a close. Any ideas? Does the
close perform the unlock if I do not specify the unlock line?
Thanks!
Michael
use Fcntl ':flock';
open (TEMP, ">db/temp") || die("Unable to open db/temp - error - $!");
flock(TEMP,LOCK_EX);
#perform operations...
flock(TEMP,LOCK_UN);
close (TEMP);
--
== CigarPool ==
http://www.cigarpool.com
------------------------------
Date: Wed, 27 Sep 2000 23:14:31 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: flock
Message-Id: <39D2E1C7.B2B70BD5@stomp.stomp.tokyo>
Michael Cook wrote:
*bites her tongue*
> I have read everything I can on fcntl & flock....
No. You wouldn't be asking these questions if you
had read everything. In reality, you haven't read
everything yet, and haven't found what you seek.
http://language.perl.com/newdocs/pod/perlopentut.html#File_Locking
You will find very nice information there and will find
better methods to accomplish your task.
> ...but I have been told more than once (but can't find any info
> to back it up), you shouldn't unlock before a close.
This is a generalized rule most mistake for an absolute rule.
For some scripts, this general notion is a wrong notion. There
are scripts which process input data, open a file for both
write and read, attain a lock, 'append' processed data results,
unlock the file, then seek and read part of this file for
old information and newly printed information, then closure
of the file followed by a print of this read information.
Using this method speeds up a script by allowing one opening
for both write and read, rather than two openings, one for
write, one for read. Note this is an append type write.
However, these types of scripts are rather specialized scripts
and, a programmer needs to know how to handle this, correctly.
Nonetheless, this style has been in use for many years and,
used in literally thousands of scripts scattered about our net,
without any problems.
General rule, however, is to close () to break a lock and,
close a file as quickly as possible. This answers your last
question about close () releasing a lock.
Godzilla!
------------------------------
Date: Wed, 27 Sep 2000 23:47:58 -0500
From: "Dale Emmons" <dale@emmons.dontspamme.com>
Subject: Re: need help with LWP/https/proxy
Message-Id: <st5j9d2bq92s44@corp.supernews.com>
"Michael Budash" <mbudash@sonic.net> wrote in message
news:tzuA5.80$QH1.85022@news.pacbell.net...
> hey all -
>
> has anyone out there ever used LWP to access a secure url thru a proxy? i
> encounter a "communications error (-8192)" when doing so... anybody got a
> clue? this is a high profile project at my current contract - i'd like to
> come out a hero!
>
> tia -
> michael
I've never done that way, but you might try this: get a script to retrieve a
page through ssl via LWP. Once you can do that, try to get a page through a
proxy. Then combine the two. Divide and conquer. BTW: I suspect that the
proxy is what's causing the problem. Maybe you should tackle that first...
------------------------------
Date: Wed, 27 Sep 2000 23:52:54 -0500
From: "Dale Emmons" <dale@emmons.dontspamme.com>
Subject: Re: Newbie windows perl question
Message-Id: <st5jih7ah4hha6@corp.supernews.com>
First of all, take anders' advice about being off-topic. This is more a cgi
question than a perl question.
Secondly, you need to have a webserver set up to try the script on your
machine. Actually, I'd recommend that you get a cheap unix virtual account
somewhere to do development from. Tetlnet, or better, SSH is a must in this
case.
<tayloremail@netscapeonline.co.uk> wrote in message
news:8qsq2l$ojg$1@nnrp1.deja.com...
> Hi all.
> I am attempting to teach myself perl, and have found a simple form
> tutorial that emails form data to a recipient specified on the form.
> I am using a windows 98 box, with ActivePerl build 618 installed.
> I have executed the test script which worked successfully.
>
>
> The form HTML follows -
>
> <form action="C:/Program files/perl/mystuff/mailform.pl" method=GET>
> <input name="to" type="hidden" value="johnsonb">
> <b>To:</b> <code>johnsonb@ncsa.uiuc.edu</code>
> <br>
> <b>Subject:</b> <input name="subject" size=40>
> <br>
> <b>Comments:</b>
> <br>
> <textarea name="comments" ROWS=8 COLS=60></textarea>
> <br><input type="submit" value="Send">
> </form>
>
>
> The perl script is called "mailform.pl" and is below -
>
> #! ./perl
> # mailform - a simple CGI program to email the contents of an HTML
> # form to a specified user.
> #
> ########################################################################
> ##
> # Configuration parameters
> ########################################################################
> ##
> # this program's name
> $progname = "mailform";
> # the sendmail binary.
> $sendmail = "C:/windows/system/sendmail";
>
> #base of your httpd installation.
> $basedir = 'C:/';
> #log file
> $logfile = "$basedir/Program files/Perl/logs/$progname.log";
>
> # today
> $date = `date`;
> chop($date);
> # begin CGI output
> print("Content-type: text/html\n\n");
> ########################################################################
> ##
> # Process Query
> ########################################################################
> ##
> @cgiPairs = split("&",$ENV{'QUERY_STRING'});
> foreach $pair ( @cgiPairs ) {
> ($var,$val) = Split("=",$pair);
> #trust me on this magic
> $val =~ s/\+/ /g;
> $val =~ s/%(..)/pack("c",hex($1))/ge;
> $cgiVals{"$var"} = "$val";
> }
> $recipient = $cgiVals{"to"};
> #define an error routine:
> sub error {
> ($message) = @_;
> print("<b>ERROR:<b>",$message,"<p>Contact the author of the previous
> page for assistance\n");
> exit(0);
> }
> if ( ! $recipient ) {
> # the form did not have a to field
> # modify this text appropriately
> &error("No Return Address");
> }
> ########################################################################
> ##
> # Check Security
> ########################################################################
> ##
> # Users who wish to use this program must
> # put the file ".allowmailform" in their home directory on the
> # machine running this script. We don't want people creating
> # forms that are abused to send "ananymous" mail.
> $homedir = (getpwnam($recipient))[7];
> if (! -e "$homedir/.allowmailform") {
> # this user does not permit the server to send mail to him. Quit.
> &error("The recipient of the form has not enabled access for this
> form");
> exit(0);
> }
> # get ready to send mail
> if ( ! open(MAIL,"| $sendmail $recipient") ) {
> &error("Could not start mail program");
> }
> ########################################################################
> ##
> # construct the headers
> ########################################################################
> ##
> print(MAIL "To: recipient\n");
> if ( ! $cgiVals{'subject'} ) {
> $cgiVals{'subject'} = "(no subject)";
> }
> print(MAIL "Subject: $cgiVals{subject}\n");
> if ( ! $cgiVals{'from'} ) {
> $cgiVals{'from'} = "nobody";
> }
> print( MAIL "From: $cgiVals{from}\n");
> #done with the headers. Add the blank line.
> print( MAIL "\n");
> ########################################################################
> ##
> # construct the body.
> ########################################################################
> ##
> foreach $key ( keys(%cgiVals) ) {
> if ( $key eq "to" || $key eq "subject" || $key eq "from" ) {
> next;
> }
> print( MAIL "$key: $cgiVals{$key}\n");
> }
> ########################################################################
> ##
> # All done. Clean up.
> ########################################################################
> ##
> close(MAIL);
> # the response.
> print("Form submitted successfully. Thanks!");
> exit(0);
>
>
> I have a couple of questions.
> 1. I ran the form from within Dreamweaver, and when I hit the SUBMIT
> button, Internet Explorer asks if I want to save the program to
> disk, or open it from it's current location. I open it, and a DOS
> window pops up with just a flashing cursor. When I hit ENTER, an
> error is displayed, but the window closes again immediately.
> Is there any way to keep the window open?
> Can I test the program from within Dreamweaver this way, or am I
> being stupid?
>
> 2. How do I run the script from the DOS prompt?
> If I run it with 'perl mailform.pl', a flashing cursor appears until
> I hit ENTER, then it gives the error "No Return Address" - which
> means the script is working!
> How do I call it and pass a return address?
>
> Thanks for any help you can give.
> Damian.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 27 Sep 2000 23:12:48 -0700
From: "Jim" <merlinjb@pyramid.net>
Subject: Re: OT: Newbie windows perl question
Message-Id: <jdBA5.406$Qz1.2504@newsfeed.slurp.net>
<tayloremail@netscapeonline.co.uk> wrote:
> <form action="C:/Program files/perl/mystuff/mailform.pl" method=GET>
I've never met a CGI script that successfully executed in a browser when
given an absolute physical location. A web server will _significantly help
matters here. Of course, that includes the double responsibility of
learning the server, along with the basic concept of CGI protocol...
> The perl script is called "mailform.pl" and is below -
[ snip ]
> #base of your httpd installation.
Here is your mention of a server:
httpd = HTTP Daemon (aka "web server")
> @cgiPairs = split("&",$ENV{'QUERY_STRING'});
> foreach $pair ( @cgiPairs ) {
> ($var,$val) = Split("=",$pair);
> #trust me on this magic
> $val =~ s/\+/ /g;
> $val =~ s/%(..)/pack("c",hex($1))/ge;
> $cgiVals{"$var"} = "$val";
> }
This author has apparently decided not to use the CGI.pm module, which makes
this much easier, though some consider it "monolithic." This may be due to
the fact that this looks like Perl 4 code, before modules were implemented.
Couldn't you find a more recent tutorial?
This code using CGI.pm can be shortened to:
foreach $var ( param() ) {
$cgiVals{$var} = param($var);
}
or even:
$cgiVals{$_} = param($_) for param(); # =)
> I have a couple of questions.
> 1. I ran the form from within Dreamweaver, and when I hit the SUBMIT
> button, Internet Explorer asks if I want to save the program to
> disk, or open it from it's current location. I open it, and a DOS
> window pops up with just a flashing cursor. When I hit ENTER, an
> error is displayed, but the window closes again immediately.
> Is there any way to keep the window open?
> Can I test the program from within Dreamweaver this way, or am I
> being stupid?
Any development IDE that supports server mapping (note the use of "server")
can be used to test CGI scripts. I've never worked with Dreamweaver, but I
know HomeSite and most higher-end HTML editors _do_ support this.
BTW, if a DOS window pops up, that's the first clue you're doing something
wrong.
> 2. How do I run the script from the DOS prompt?
> If I run it with 'perl mailform.pl', a flashing cursor appears until
> I hit ENTER, then it gives the error "No Return Address" - which
> means the script is working!
> How do I call it and pass a return address?
CGI.pm module provides a way to test CGI scripts from the command line by
entering form data at the prompt. It still won't work in your browser
without a server, but you can check the HTML if you don't mind parsing it by
eye and looking at the HTTP headers.
The fact that you didn't know it was a CGI question is the only reason I'm
answering this question....again. Any further posting on this matter should
be done on a CGI group, preferably with _slightly_ more recent code.
Regardless of posting info, this message submitted by Tim Hammerquist
timmy@cpan.org... remember me? =)
------------------------------
Date: Thu, 28 Sep 2000 15:41:47 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl on Windows
Message-Id: <MPG.143d85219cded09d9897d9@localhost>
kassebaum@my-deja.com wrote ..
>> How can I keep it open so I can view the final
>>output?
>
>Use this as your final line:
>
><>;
>
>Any key will then end the program. (I hope. I'm a
>beginner.)
come back when you're more certain .. uncertain answers do nothing to
help others who are struggling to understand things
your solution above is not a good one .. you should be able to see that
this question has been answered and the originator is satisfied
you would do well to read that answer and heed it rather than using the
hack that you're using above
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 28 Sep 2000 04:36:26 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Shortest code for Fibonacci?
Message-Id: <39D2CD7F.3E73455C@home.com>
Mark-Jason Dominus wrote:
>
> And for non-powers of two, which is most numbers, it's slower, because
> it does a whole bunch of extra multiplication. My changes eliminated
> a lot of arithmetic and parameter passing.
My change eliminates a function call whenever n is odd. So in the best
case for numbers of the form (2**n - 1), there will be (n - 1) fewer
function calls. I think this makes up for one extra multiplication per
call, especially in Perl, where the function call overhead is so high.
> I don't understand what you're trying to accomplish here, unless it's
> a low golf score.
That was the point of the slice. It could have been written out as an
if-else as you had it, such that the even case was identical to yours.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Thu, 28 Sep 2000 04:18:33 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Suggestion for Web interface to DBI?
Message-Id: <tEzA5.16872$PW4.5668458@typhoon.southeast.rr.com>
Jesse T Sheidlower <jester@panix.com> wrote in message
news:8quc6j$69o$1@panix2.panix.com...
> I'm a relatively novice programmer looking for some advice on
> a Web interface to a DBI database. I have a fairly straightforward
> database of books, and I think I can handle most of the specific
> display functions I need. But I was trying to find something to
> use as example code for the usual maintenance (add/delete, modify,
> etc.) features; I don't feel confident that I could write it
> from scratch myself.
>
> I had originally started with an address-book program that was
> in the _CGI Programming with Perl_ book, but it ended up being
> too much effort to modify into what I needed. There were a
> number of programs at perlarchives.com, but I wasn't sure where
> to start; the few I looked at seemed either too basic or so
> advanced that I wouldn't be able to modify them without a lot
> of work.
Have a look at DBIx::glueHTML and DBIx::HTMLinterface on CPAN.
I've never used either of them before... just saw them listed.
hth,
p
------------------------------
Date: Thu, 28 Sep 2000 06:28:51 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: What does this do?!
Message-Id: <slrn8t5pgc.s7.tjla@thislove.dyndns.org>
I was shocked! How could Yanick Champoux <yanick@babyl.sympatico.ca>
say such a terrible thing:
> My second guess it that it was a typo of the original poster
>and that the real line is '$o=~s/X*$/ if $d;'. Would make sense
>too. Of course, it is very possible that the line has been thrown in
>as a gratuitous monkeywrench for the poor reverse-engineers' mind. :)
Yes you are right. I just checked my copy of the original source and it
is $o =~ etc...; That makes much more sense too.
>:>$0 =~ s/X*$// if $d;
>
>: too weird. obscure the name only if decrypting?
>
> Can an encryption program really be 'too weird'?
>I mean, by definition, weird is unearthly and
>unexplainable. So, the weirder a program is
>(past a sufficient large value of weirdness), the
>better the encryption will be, no? :)
Security by obscurity is no security I thought :)
>hum... 54 values... pack labeled as 'punny'...
>cryptic mention of cards...
>
>Are we looking at a demented implementation of
>the solitaire game, per any chance?
Very good, I knew you'd get the name right eventually! Although it's not
a version of the game per-se but rather an encryption algorithm that can
be carried out with a pack of cards, hence the name solitaire. I think
if you read the code with that in mind you will be able to understand
how it works much more easily.
It was invented by a guy called Neal Stephenson for his book
"Cryptonomicon" which is I believe the only novel ever written for
computer geeks. Very worthwhile.
Anyway the algorithm is what is called a "one time pad" which is I
believe provably unbreakable so long as a few simply stated conditions
are held. I think it would actually make a pretty cool module...
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Just because your doctor has a name for your condition doesn't mean he
knows what it is.
-- Unknown
------------------------------
Date: Thu, 28 Sep 2000 06:34:06 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: What does this do?!
Message-Id: <slrn8t5pq7.s7.tjla@thislove.dyndns.org>
I was shocked! How could Gwyn Judd <tjla@guvfybir.qlaqaf.bet>
say such a terrible thing:
>Anyway the algorithm is what is called a "one time pad" which is I
>believe provably unbreakable so long as a few simply stated conditions
>are held. I think it would actually make a pretty cool module...
hehe I was too slow:
perldoc Crypt::Solitaire
.0::Crypt::SoliUsereContributed Perl Docum.0::Crypt::Solitaire(3)
NAME
Crypt::Solitaire - Solitaire encryption
SYNOPSIS
use Crypt::Solitaire;
my $encrypted = Pontifex( $plaintext,
$passphrase, $mode );
etc...
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
There isn't a particle of you that I don't know, remember, and want.
-- Noel Coward
------------------------------
Date: Wed, 27 Sep 2000 23:22:58 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: why "Prototype mismatch"?
Message-Id: <Pine.LNX.4.21.0009272321100.19352-100000@hawk.ce.mediaone.net>
On Wed, 27 Sep 2000, Prem Makhijani quoth:
PM> On running this perl script, perl complains about "Prototype mismatch", why
PM> so?
PM> DRIVE_FIXED is a constant.
It looks to me that that is not the case.
perldoc perldiag
anm
--
$ENV{PAGER} = 'cat';
system perldoc => '-t', '-F', $0;
=head1
Just another Perl Hacker
------------------------------
Date: Thu, 28 Sep 2000 16:13:50 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: why "Prototype mismatch"?
Message-Id: <MPG.143d8ca531aabbd9897db@localhost>
Prem Makhijani wrote ..
>On running this perl script, perl complains about "Prototype mismatch", why
>so?
>DRIVE_FIXED is a constant.
>
>#-------------------------------------
>use strict;
>use Win32API::File ;
>my @Drives=Win32API::File::getLogicalDrives();
>foreach (@Drives){
> my $DriveType=Win32API::File::GetDriveType($_);
> if ( $DriveType == Win32API::File::DRIVE_FIXED() )
> {
> print "*";
> }
> print "$_\t$DriveType\n";
>};
>#-------------------------------------
>
>OUTPUT is ...........................
>
>Prototype mismatch: sub Win32API::File::DRIVE_FIXED vs () at (eval 1) line
>1.
under v5.6 build 616 with v0.09 of Win32API::File I get no such warning
.. I'd try taking off the blank ()s .. I don't know how that could cause
a prototype mismatch .. but that appears to be what the error is saying
to you
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 4455
**************************************