[16520] in Perl-Users-Digest
Perl-Users Digest, Issue: 3932 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 7 06:05:31 2000
Date: Mon, 7 Aug 2000 03:05:17 -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: <965642717-v9-i3932@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 7 Aug 2000 Volume: 9 Number: 3932
Today's topics:
Re: a simple question (Abigail)
Re: Actually..... Re: Parse::RecDescent with left-recur <ocschwar@mit.edu>
Re: checking for the existence of a file (David Efflandt)
combinations - a better way to do this? <crasssh@my-deja.com>
Re: Difference between a .cgi file and a .pl file? <jthomas@pdxgothic.com>
Re: Directory mover <gellyfish@gellyfish.com>
Re: Dreaded 500 message <gellyfish@gellyfish.com>
Re: Editing.cfg file for use with anti-leech Perl scrip <gellyfish@gellyfish.com>
Re: find the number of characters in a string (Keith Calvert Ivey)
Re: find the number of characters in a string <uri@sysarch.com>
Re: find the number of characters in a string <godzilla@stomp.stomp.tokyo>
Re: find the number of characters in a string <godzilla@stomp.stomp.tokyo>
Re: find the number of characters in a string <uri@sysarch.com>
Re: find the number of characters in a string samurai@metallicafan.com
Re: get files from other servers <gellyfish@gellyfish.com>
Re: get the website content <andre@UltraShell.Net>
Re: How do I send data to another Server ??? classies@my-deja.com
Re: How should I redo <flavell@mail.cern.ch>
Re: How to capture CGI program .exe output, modify it a <barrybx@my-deja.com>
Re: Impossible RegEx Problem <rickysregistration@hotmail.com>
Re: is mysql faster using Perl or PHP? <jimjamjoh@softhome.net>
Re: is mysql faster using Perl or PHP? (Rafael Garcia-Suarez)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 07 Aug 2000 04:57:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: a simple question
Message-Id: <slrn8osgdg.st1.abigail@alexandra.foad.org>
Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMDXXXII September
MCMXCIII in <URL:news:m1bsz6xo3w.fsf@halfdome.holdit.com>:
__ >>>>> "VTAM" == VTAM 203 <VTAM_203@email.msn.com> writes:
__
__ VTAM> I have a script for a class from one of my perl books. There's one line in
__ VTAM> it I don't understand.
__
__ VTAM> Here's the script for the constructor of this class:
__
__ VTAM> sub new {
__ VTAM> my $proto = shift; # allow use as a class or object method
__ VTAM> my $class = ref($proto) || $proto;
__ VTAM> return bless({}, $class);
__ VTAM> }
__
__ VTAM> Can anybody explain to me what the "my $class = ref($proto) || $proto
__ VTAM> statement does"?
__
__ it makes
__
__ my $something_like_x = $x->new;
__
__ act like
__
__ my $something_like_x = (ref $x)->new;
__
__ In other words, copy the class of $x to $something_like_x, without
__ giving any hint as to whether it's a clone or a copy.
__
__ I disagree with this practice. If you want ->clone, write a clone
__ method (new empty object with same species as previous). If you want
__ ->copy, write that (new object with same *contents* as previous).
__
__ $instance->new can be either of those in my mind, so you've just now
__ overloaded ->new in too many ways. If the goal of the OO interface is
__ to communicate, then use it, durn it!
I don't think I've ever used $instance -> constructor () either,
but I almost always have the my '$class = ref $proto || $proto;' in my
constructors. I think that whether to use $instance -> constructor () is
a decision that is to be made by the programmer making new objects. It's
not a decision the class should enforce onto the user. Such enforcement
is anti-Perl.
__ Personally, I never have written ->new to be an instance method.
__ It goes against my grain. In fact, I rarely write ->new. I usually
__ write something that makes sense within the domain. Like:
__
__ my $tv_horse = Horse->named("Mr. Ed");
__
__ Only C++ people think that you have to call every constructor "new". :)
I also don't always call my constructors 'new', but each time I don't,
I have to think what Kernighan and Pike write about the merits of common
idiom in 'The Practise of Programming'.
But then, I sometimes export my constructors, so the can be called without
a class or instance....
Abigail
--
perl -Mstrict -we '$_ = "goto L.print chop;\n=rekcaH lreP rehtona tsuJ";L1:eval'
------------------------------
Date: Mon, 07 Aug 2000 01:22:46 -0400
From: Omri Schwarz <ocschwar@mit.edu>
Subject: Re: Actually..... Re: Parse::RecDescent with left-recursive grammar.
Message-Id: <398E47A6.E11CEB9C@mit.edu>
Damian Conway wrote:
>
> Omri Schwarz <ocschwar@mit.edu> writes:
>
> >Damian Conway wrote:
>
> [Issues with the C grammar]
>
> Thanks for those. I'll need to look at it when I get some time.
>
> Unless anyone else wants to volunteer to take over maintenance of the
> RecDescent C Grammar from Hell :-)
If it turns out to need more changes I'll post a diff.
------------------------------
Date: Mon, 7 Aug 2000 05:09:59 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: checking for the existence of a file
Message-Id: <slrn8osh4o.u1o.efflandt@efflandt.xnet.com>
On Sun, 06 Aug 2000 23:35:08 GMT, stoph <stoph@mail.com> wrote:
>i am trying to check for the existence of a file under nt.
>The catch is the file (about 5gig) is being copied via ftp and i want
>to know when its done coping. if i catch it with -e (-z/-s), it exits
>when the file copy begins. is there a way i can know when the file is
>finished coping?
>
>above and beyond that (knowing there are about 20 ways to do the same
>thing in perl), is there a more efficient way of doing it than this?
>
>
>$lookingfor = "stoph.xxx";
>until ($found) {
> $found = "true" if (-e $lookingfor);
> if (not $found) {sleep 1;}
> }
>
>please reply via email @stoph@mail.com
You could use the -s test to compare resulting file size with the size of
the file being sent. This would work fine for binary files or ascii
between similar OS, but would be problematic for ascii transfer between
different operating systems, since text files have different line endings
between DOS/Win, Unix and Mac. Or you could check the size and when it
stops changing for a given period of time, assume that it has finished
(unless your connection sometimes drops without warning).
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Mon, 07 Aug 2000 08:33:39 GMT
From: Chris W. <crasssh@my-deja.com>
Subject: combinations - a better way to do this?
Message-Id: <8mls93$kgc$1@nnrp1.deja.com>
This is the first time I've used Perl for anything where I care about
speed and efficiency. I have a working piece of code, but would
appreciate pointers to any performance improvements.
The problem: I have a set of data on individuals and want to compare
the result of performing an analysis with various members of the set
missing. I want to use Perl to generate replicates of the data with
different individuals' data missing. The analysis *will* be slow and so
I want to run it as few times as possible. Within the set of
individuals, some are 'equivalent' - ie running the analysis with one
missing would be the same as running with the other missing, so I want
to run only once. In the example below, individuals '0' and '1' are
equivalent since $classes[0] = $classes[1], as are individuals '2', '3'
and '4'.
The code: I use a subroutine proc to fill a 2-d array @combinations
with all the combinations of individuals, so that for a set of 3
individuals I should get
@{ $combinations[0] } = (0,
1,
2) and
@{ $combinations[1] } = (0, 1,
0, 2,
1, 2)
I then use newoutput to run over each row of this array, spitting out a
set when the (sorted) classes associated with a particular combination
hasn't been met before (those that have are listed in @done).
I'm still a relative Perl newbie and my code reflects this. To anyone
who is prepared to spend time picking it apart and cristicising it: many
thanks.
Chris.
#!/usr/bin/perl -w
use strict;
my @classes = ('1','1','2','2','2','3');
my @data = ('--','--','--','--','--','--');
my $missing_value = '**';
my $max_missing = 2;
my (@combinations,
@done);
# create combinations of the indices
&proc([], (0..$#data));
# data output for those combinations which refer to a set of unique
classes
for my $combcounter (1 .. $max_missing) {
&newoutput($combcounter, @{ $combinations[$combcounter-1] } );
print "\n"; }
sub newoutput {
my ($n, @combin) = @_;
for my $index (0 .. ($#combin+1)/$n-1) {
my @tmpclass = ();
for my $i (0 .. $n-1) {
push @tmpclass, $classes[$combin[$index*$n + $i]]; }
my $classset = join(' ', sort @tmpclass);
unless (&elementof($classset,@done)) {
my @newdata = @data;
for my $i (0 .. $n-1) {
$newdata[$combin[$index*$n + $i]] = $missing_value; }
print "@newdata\n";
push @done, $classset;
}
}
}
sub elementof {
return 0 if $#_ == 0;
my ($element, @array) = @_;
for (@array) { return 1 if $element eq $_; }
return 0;
}
## This from Sitaram Chamarty - see
##http://faqchest.dynhost.com/prgm/perlu-l/perl-99/perl-9912/perl-991202
/perl99122713_04014.html
sub proc
{
my($startref, @more) = @_;
my @start = @$startref;
for (1..$max_missing) {
push @{ $combinations[($_-1)] }, @start if @start and @start == $_
}
return if @start == $max_missing;
# Now move each element of more over to start one at a time and
recurse...
foreach my $index (0 .. $#more) {
proc([@start, $more[$index]], @more[$index+1 .. $#more]) }
}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 7 Aug 2000 01:45:29 -0700
From: "Jack Thomas" <jthomas@pdxgothic.com>
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <398e789f$1_2@news.nwlink.com>
Perl .pl and Perl .cgi are file types which are equivalent.
If you want to convert a .pl file to a .cgi file, you simply need to rename
it.
Jack Thomas
jthomas@pdxgothic.com
"DS" <snakeman@kc.rr.com> wrote in message
news:vjmc5.94$L5.2310@typhoon.kc.rr.com...
> What is the diference betweeen a .pl file and a .cgi file?
> Can I convert a .pl to a .cgi?
>
>
> Thanks
> Dirk
>
>
------------------------------
Date: 7 Aug 2000 10:02:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Directory mover
Message-Id: <8mltvk$qrq$1@orpheus.gellyfish.com>
On Fri, 4 Aug 2000 00:13:56 -0500 (CDT) BUCK NAKED1 wrote:
> I overlooked that Net:FTP module does not work on Unix.
>
Huh ? Of course it does.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 7 Aug 2000 09:09:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dreaded 500 message
Message-Id: <8mlqs8$gm4$1@orpheus.gellyfish.com>
On Sun, 06 Aug 2000 07:54:43 -0400 Kokuryu wrote:
> Gwyn Judd wrote:
>>
>> I was shocked! How could Kokuryu <kokuryu2@hotmail.com>
>> say such a terrible thing:
>> >Well, it's a good thing I didnt bother posting any code up here -
>> >because the code works just fine!
>>
>> I guess we can all sleep easier knowing that.
>>
>> >Guess what? It all worked perfectly from then on.
>>
>> *shrug* who cares? This is comp.lang.perl.misc not
>> comp.oh-my-god-my-computer-doesn't-work.drool.drool.drool.
>>
>> >Next time, please read the message that someone posts rather than jump
>> >to the conclusion that there is something wrong with the code.
>>
>> We did. If there is nothing wrong with the code then it's not a Perl
>> problem. If it's not a Perl problem then why post it here? There are
>> more appropriate newsgroups for this sort of thing. Next time I suggest
>> you familiarise yourself with the newsgroup before you post and stop
>> asking FAQ's.
>>
> Excuse me - but this IS the PERL group
That is 'Perl' please see perlfaq1 for more on this.
> and the problem IS related to the
> ActivePerl setup and the fact that it DOES NOT WORK WITH THE MS PERSONAL
> WEB SERVER - quite contrary to all instructions as given all over the
> internet.
Then it is a problem with that Web Server isn't it ? And thus your question
should properly be asked in the appropriate comp.infosystems.www.servers.*
newsgroup.
> Why nobody has caught on that this critical piece of
> information is erroneous and has been for years is probably due to the
> same snobbish attitude that you are exhibiting as well.
I really dont know what you are talking about - I have had Perl working
with PWS for years. That you have chosen the wrong group to ask about
this is surely not our problem.
> A complete lack
> of ability to actually do anything. How "up" with Perl are you? Are
> you ready for Perl 6? Are you ready to replace every Perl script you
> have ever written just to support Perl 6? Do you even care that the
> implementation of Perl 6 may just halt web development for a year until
> all the servers that want to support it will? Do you know what servers
> run Perl 6 now? Do you even care?
Huh ? Perl 6 doesnt exist yet, so I don't know what you are talking about.
> If you can't even answer these
> questions, then why bother to troll thru the messages in the first
> place? These are all relavent to this same newsgroup - all relavent to
> the Perl language. They may not be programming questions.
In the end no-one cares. You get out of your pram you get in my killfile.
*plonk*
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 6 Aug 2000 17:32:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Editing.cfg file for use with anti-leech Perl script...
Message-Id: <8mk3ub$3r1$1@orpheus.gellyfish.com>
On Sun, 06 Aug 2000 12:39:24 GMT Cyber Thief wrote:
>
> Would you rather have the bucket of water on the top
> of the ajar door, or nothing at all?
>
It takes a lot of effort to get the bucket there in the first place, it
doesnt stop burglars and you have to clean up the mess afterwards.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 07 Aug 2000 03:41:45 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: find the number of characters in a string
Message-Id: <39932f7b.30581343@news.newsguy.com>
Uri Guttman <uri@sysarch.com> wrote:
>but length is still a better way to get the number of chars in a
>string. so you were wrong in that way.
Yes, but Jim was answering how to get the number of *letters* in
a string, and length() won't work for that. Who knows what the
original poster wanted, since the subject line and the body
didn't agree.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
------------------------------
Date: Mon, 07 Aug 2000 04:39:14 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: find the number of characters in a string
Message-Id: <x7snsh1y8d.fsf@home.sysarch.com>
>>>>> "KCI" == Keith Calvert Ivey <kcivey@cpcug.org> writes:
KCI> Uri Guttman <uri@sysarch.com> wrote:
>> but length is still a better way to get the number of chars in a
>> string. so you were wrong in that way.
KCI> Yes, but Jim was answering how to get the number of *letters* in
KCI> a string, and length() won't work for that. Who knows what the
KCI> original poster wanted, since the subject line and the body
KCI> didn't agree.
well the OP's subject and question were contradictory as others have
mentioned. my main point was that jim's solution did work for what his
goal was and our resident moron was wrong as usual. an empty second part
of tr/// just makes a copy of the first part.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 06 Aug 2000 21:46:13 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: find the number of characters in a string
Message-Id: <398E3F15.1F38FD74@stomp.stomp.tokyo>
Keith Calvert Ivey wrote:
> Uri Guttman blathered:
> > but length is still a better way to get the number of
> > chars in a string. so you were wrong in that way.
> Yes, but Jim was answering how to get the number of *letters* in
> a string, and length() won't work for that. Who knows what the
> original poster wanted, since the subject line and the body
> didn't agree.
Topic: Bill Clinton Caught With His Pants Down.
Body: Bill Clinton is caught with his pants down or,
is Monica caught with his pants in her hands?
Many hold a viewpoint Monica seduced Bill....
Those of us moderately proficient in language usage
and techniques, especially in writing essay style
articles, are well aware a Topic Title is a rather
generalized statement to provide an overall quick
view of Body content as a courtesy to a reader.
Cut this cheese any ol' way you boys want, this remains
a clear case of smelly reading and subsequent immature
whining wallowed in mule manure personal insults.
Pay attention out there. Never know but what a cranky
English teacher might be standing by, red pencil in hand,
ready to redline you for being caught with your pants down.
"Good Ol' Boys are boys."
- Kira
Godzilla!
------------------------------
Date: Sun, 06 Aug 2000 22:17:52 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: find the number of characters in a string
Message-Id: <398E4680.79F82002@stomp.stomp.tokyo>
Uri Guttman slobbered:
> Keith Calvert Ivey wrote:
> > Uri Guttman blathered:
> >> but length is still a better way to get the number of chars in a
> >> string. so you were wrong in that way.
> KCI> Yes, but Jim was answering how to get the number of *letters* in
> KCI> a string, and length() won't work for that. Who knows what the
> KCI> original poster wanted, since the subject line and the body
> KCI> didn't agree.
> well the OP's subject and question were contradictory as others have
> mentioned. my main point was that jim's solution did work for what his
> goal was and our resident moron was wrong as usual. an empty second part
> of tr/// just makes a copy of the first part.
"pfffttt... you gave a correct answer via
paying attention to what you read."
"This avoids messing with your data. However many would
wig-out over this and toss a real hissy fit."
I am often right on target regarding human nature,
especially involving predictable immature boys.
* brays like a MIT mule *
You really should, Uri, enroll in a course of
study in Bonehead English to compensate for
your low quality education at MIT, if it is
true you attended MIT as rumored. Most of our
colleges and universities produce graduates
with enhanced writing and reading skills.
Sometimes I wonder if Ivy League universities
even bother teaching basic skills in English
composition and, comprehension.
Godzilla!
------------------------------
Date: Mon, 07 Aug 2000 05:25:20 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: find the number of characters in a string
Message-Id: <x7punl1w3j.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
G> * brays like a MIT mule *
beaver is more correct.
G> You really should, Uri, enroll in a course of study in Bonehead
G> English to compensate for your low quality education at MIT, if it
G> is true you attended MIT as rumored. Most of our colleges and
G> universities produce graduates with enhanced writing and reading
G> skills.
you are the master of bonehead english and perl. i am humbled by your
skills in that art.
now go away again, this time forever. you are not wanted by anyone
here. it is NOT your newsgroup, your perl nor your internet. other than
satisfying your psychotic delusions and troll needs, why are you here?
other than newbies who fall for you sugar coated trash, no one has here
has ever considered you anything but a troll. oh, well we can all be
wrong all the time and you are correct. NOT!
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Mon, 07 Aug 2000 00:35:51 -0700
From: samurai@metallicafan.com
Subject: Re: find the number of characters in a string
Message-Id: <398E66D7.95299F02@metallicafan.com>
"Godzilla!" wrote:
> Oh, not a rant at all. My perspective is one of an English teacher.
> Isn't this the jist?
Hey English teacher, you spelled gist wrong. Better head back to school.
And stop harassing me, I'll call the police.
///
--
I would wish to learn the bases of the cracking.
Ps: saddened for my English but it goes out of an automatic translator.
------------------------------
Date: 7 Aug 2000 09:27:14 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: get files from other servers
Message-Id: <8mlrt2$k1a$1@orpheus.gellyfish.com>
On Fri, 04 Aug 2000 14:35:45 GMT aaron@preation.com wrote:
> In article <8mebo2$j56$1@nnrp1.deja.com>,
> aqutiv@my-deja.com wrote:
>> In article <8me1l1$cvp$1@news2.kornet.net>,
>> "Louie G. Kim" <gk@bncol.com> wrote:
>> > Is there any way to get files from other servers?
>> >
>> > When i am on server A, I want to get fileA from server B or
>> > I want to display fileA at server B.
>> >
>> > GK
>> >
>> >
>>
>> use lwp...
>> for example:
>>
>> use lwp::simple;
>> print get "http://redhat.com";
>
>
> Yeah, you'll want to use the LWP module, it is so easy to use.
>
> Also, if you want to see it, there is a great article in The Perl
> Journal, on page 69 about one use of LWP. It shows a couple of steps
> about how to work with it. LWP acts with a Web browser-like protocol,
Er yes that'll be HTTP.
> and can get almost any information (I can't get it to work with secure
> connection URLs) that your browser can.
>
To connect to SSL servers you will need to obtain either Net::SSL or
IO::Socket::SSL - LWP will use them if they are present.
> But if the files you need to get are not visible to the public and a
> http browser, I am not sure how you can get access to them.
>
> Can anyone tell me if there is a way to do this?
>
Not by HTTP no, you will have to make the files available by some protocol
or service for you to get them.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Mon, 07 Aug 2000 08:13:10 GMT
From: Andre van Straaten <andre@UltraShell.Net>
Subject: Re: get the website content
Message-Id: <qcuj5.3732$ov2.50174@news-west.usenetserver.com>
unplug <unplug@poboxes.com> wrote:
> Hi all,
> Is it possible to get the website content using Perl??
> Any example about it??
Two simple examples are on my Web site. Go "scripting", "Web monitor".
-- avs
Andre van Straaten
http://www.vanstraatensoft.com
______________________________________________
flames please to /dev/null@vanstraatensoft.com
------------------------------
Date: Mon, 07 Aug 2000 09:33:49 GMT
From: classies@my-deja.com
Subject: Re: How do I send data to another Server ???
Message-Id: <8mlvpu$mne$1@nnrp1.deja.com>
OK, I didn't explain it properly.
Sorry, I need all the help I can get as I need to get this done but
also learning in the same process as I am new to this.
I send form data from HTML to CGI-Bin to my Perl Scrip on a Linux PC.
This I can do.....
I Can also send the data back to the HTML Page.
What I do need is the following.
The Code or Function in the Perl Script to pass these data to another
PC which is Windows NT that have a API or Function in a DLL that will
receive these Values or data and do some Excel Calculations and send it
back to the PERL Script on the Linux PC.
How do I send My $Form{$Fileds} to the Windows NT PC to a DLL called
SARACEN.DLL
Hope this is clearer....
Thanks
In article <398AEF78.968091AA@vpservices.com>,
Jeff Zucker <jeff@vpservices.com> wrote:
> hugo.b@derivs.com wrote:
> >
> > I need to send some stringvalues to another server for calculation
and
> > then receive them back to send it to the HTML Page.
>
> Translated into technical language, that questions becomes "I need to
> send some stringvalues to a glurrble and recieve them back and send it
> to the HTML Page." If we knew what a "glurrble" is, we could offer
some
> advice.
>
> Guessing at some possible values for glurrble -- if glurrble is a
> database application on another machine, look into DBI and DBI::Proxy;
> if glurrble is a CGI script on another machine, look into LWP; if
> glurrble is something else, look into IPC or or go ask on
> alt.glurrbles.misc about how to talk to glurrbles. Once you find out
> how to talk to your glurrble, if you're having trouble doing that in
> Perl, come back and tell us what you've tried.
>
> (DBI and LWP are Perl modules, see http://search.cpan.org/ for more
> info. IPC is a series of Perl functions dealing with Inter Process
> Communications, see the Perl docs for more info).
>
> --
> Jeff
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 7 Aug 2000 11:17:20 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How should I redo
Message-Id: <Pine.GHP.4.21.0008071059370.16865-100000@hpplus03.cern.ch>
On Mon, 7 Aug 2000, Bart Lateur wrote:
> and don't forget to wrap it in a proper HTML document, preferably marked
> as ISO-Latin-1 (META -> HTTP-EQUIV -> Content-Type tag).
^^^^^^^^^^^
Pardon me stepping in here with some relatively off-topic points, but
I think it would be better to say "marked as charset=iso-8859-1",
assuming that's what you mean.
"ISO Latin-1" defines only a repertoire of characters. There's only
one "ISO" 8-bit coding of that repertoire, namely iso-8859-1, but the
same repertoire could, at least in theory, be coded in CP-850 (DOS
Latin-1) or EBCDIC codepage 1047 (EBCDIC Latin-1), or even as a subset
of utf-8 etc. What the 'charset' parameter of the Content-type tag
defines is (confusingly enough) what is nowadays called a "character
coding" (the legacy name in the MIME specifications which implies
"character set" is unfortunate, and in an HTML context particularly
misleading, since the HTML term "document character set" refers to
something fundamentally different, and is by definition always
Unicode/iso-10646).
And btw it's slightly preferable to define content-type and charset on
a real HTTP header, rather than stashing it into a META HTTP-EQUIV.
But the reasons for that are rather subtle, and I guess those authors
who are in one of the relatively unusual situations where it makes a
critical difference would already have learned this.
Some further reading if anyone's interested - start at
<own-trumpet> http://ppewww.ph.gla.ac.uk/~flavell/charset/quick </>
------------------------------
Date: Mon, 07 Aug 2000 18:00:20 +0800
From: barry <barrybx@my-deja.com>
Subject: Re: How to capture CGI program .exe output, modify it and then pass back to browser (client)
Message-Id: <398E88B4.74727C25@my-deja.com>
Hi Jason Maggard,
Thanks for you kindly reply. I'll try (understand/use) it.
Best Regard,
Barry
Jason Maggard wrote:
> Barry,
>
> If it's a compiled .exe you need to wrap it in another program first:
> cgi.perl -> output -> cgiprogram.exe -> output -> cgi.perl -> output -> browser
>
> The biggest problems that you will have with this approach is increased
> overhead, will you require interprocess communication, and passing vars.
>
> This is assuming that it is a compiled program that does not allow for this kind
> of configuration.
>
> Look at the LWP modules like User Agent...
> # Data is the post data from the original form
>
> $data = @_ # Get data
>
> # Create a request From the perldoc
> my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-bin/BugGlimpse';
> $req->content_type('application/x-www-form-urlencoded');
> $req->content($data);
>
> my $res = $ua->request($req);
>
> if ($res->is_success) {
> print $res->content;
> } else {
> print "Bad luck this time\n";
> }
>
> Some of the syntax is off, and this wouldn't parse, but I think you get the
> idea.
>
> barrybx@my-deja.com wrote:
>
> > Hi All,
> >
> > I'm a CGI dummy. This is a lengthy question, I really hope someone can help
> > (save) me.
> >
> > I have a CGI program with no source code, i.e. cgiprogram.exe.
> >
> > The arguments pass to the cgi program must use post method, like the
> > following:
> >
> > <form action=http://www.dummy.net/cgiprogram.exe method=post>
> > <input name=par1 value=val1>
> > <input name=par2 value=val2>
> > ...
> > </form>
> >
> > The output of the cgi program is directly return the browser (client). The
> > format of the output is binary Content-Transfer-Encoding and the
> > Content-type: text/html, i.e. somewhat like a binary html.
> >
> > I need to run the cgi program, get value from the output and redirect the
> > output (data) to another url (html page).
> >
> > That means:
> >
> > Originally,
> > cgiprogram -> output -> browser
> >
> > Intented to,
> > cgiprogram -> output -> another cgi program -> browser
> >
> > Do I need to write something like a cgi proxy program (that a big project to
> > me), or somewhat like a filter ?
> >
> > My main concern is how can I get the binary html data and redirect it to a
> > cgi program instead of printing to browser directory.
> >
> > Could anybody kindly give me some advice or suggestion?
> >
> > Recommended booklist or examples are welcomed.
> >
> > Thanks.
> >
> > Hope someone can understand my words.
> >
> > Best Regards,
> > Barry
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 04:42:35 GMT
From: "Earthlink News" <rickysregistration@hotmail.com>
Subject: Re: Impossible RegEx Problem
Message-Id: <%6rj5.25283$Z6.653123@newsread1.prod.itd.earthlink.net>
Keith Calvert Ivey <kcivey@cpcug.org> wrote in message
news:3992066c.20068444@news.newsguy.com...
>
> Why not use a hash for the parameters?
>
Hi Keith,
That, in fact, is exactly where I do use these suckers. E.g., I have a hash
called %hrdiagram; one of the parameters we'd specify ahead of time might be
solar mass so then you'd have $hr{'mass'} = '1.4'. Now if we wanted to
specify luminosity later on (and we're already using $luminosity elsewhere),
I can just say $hr{$p} where $p == 'luminosity' and $$p (same as
$luminosity, used elsewhere in the programs) is its value; so to set the
luminosity all I have to do is $hr{$p} = $$p (and the config file would have
the entry for luminosity: of course). The problem arose when this
abstraction forced me to parcel out some of the star-specific parsing to the
config file rather than have it hard-coded into the program itself for each
star. But, on another note, I'd like to thank Jim, NoBull, and you. You
guys really helped me out and I appreciate it. I'm trying to field a few of
the easier questions on the newsgroup by way of thanks... :)
Regards,
Rick.
------------------------------
Date: Sun, 06 Aug 2000 23:47:42 -0500
From: Kris Gonzalez <jimjamjoh@softhome.net>
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <398E3F6E.B46E5E19@softhome.net>
Hamed...
From what I've read, PHP is designed with the intent of interacting with
an SQL database (of which MySQL is one of the fastest, if not the most
fully-featured). The Perl DBI allows interaction with SQL databases but
is more taxing on resources than PHP.
-kg
hamed53@my-deja.com wrote:
> Hi,
>
> can those people with expeirnce using MySQL on Perl and PHP tell me
> which langauge is faster to write a mysql database connection with?
>
> Best regards
> Hamed
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Mon, 07 Aug 2000 06:59:19 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: is mysql faster using Perl or PHP?
Message-Id: <slrn8osns1.fgf.rgarciasuarez@rafael.kazibao.net>
hamed53@my-deja.com wrote in comp.lang.perl.misc:
>Hi,
>
>can those people with expeirnce using MySQL on Perl and PHP tell me
>which langauge is faster to write a mysql database connection with?
"faster to write" depends on how fluent you are in these languages.
There is not much code to write in both languages.
Perl is more portable though (because it uses an unified database
interface, known as the DBI), and seems to handle more correctly
tricky stuff such as embedding user-provided values in SQL statements,
or error handling. But I'm biased towards perl.
--
Rafael Garcia-Suarez
------------------------------
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 3932
**************************************