[13105] in Perl-Users-Digest
Perl-Users Digest, Issue: 515 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 13 22:07:17 1999
Date: Fri, 13 Aug 1999 19:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 13 Aug 1999 Volume: 9 Number: 515
Today's topics:
Re: Can Perl 5 open a 4 gig text file? <tchrist@mox.perl.com>
Re: CGI and Blat - Help! <phony@nospam.com>
Re: Database Connection Pooling with Perl <tmornini@netcom9.netcom.com>
Re: Fastest form of an 'if' (Greg Andrews)
Re: How to delete an element from an array (Greg Andrews)
Re: i cann't read and write at the sametime (Donovan Rebbechi)
Re: Nastiness contrary to the spirit of perl? (Id Est)
Re: Passing associative arrays to CGI scripts (perl) <makkulka@cisco.REMOVETHIS.com>
Re: perl and I18N <tchrist@mox.perl.com>
using the cd command in perl on Windows98 <mark_and_kylie@email.msn.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Aug 1999 19:09:42 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can Perl 5 open a 4 gig text file?
Message-Id: <37b4c1d6@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, "Duncan Idaho" <kretek@fastlane.net> writes:
:I've run into a problem trying to read a 4 gig text file
:with Perl5.
Yes, this is a known problem. We're working on it.
There's a mailing list at perl-64bit@perl.org for people
working on this.
--tom
--
lint(1) is the compiler's only means of dampening the programmer's ego.
------------------------------
Date: 14 Aug 1999 01:08:04 GMT
From: "Bart Simpson" <phony@nospam.com>
Subject: Re: CGI and Blat - Help!
Message-Id: <7p2fhk$8m1$0@216.39.133.24>
<imark@csource.net> wrote in message news:7p1o3g$9cj$1@nnrp1.deja.com...
> Hi,
>
> I really hoping someone might be able to help me or point me to someone
> who
> can. I'm running a shopping cart cgi script on a secure WinNT server.
> Unfortunately I'm getting dick all tech support from the makers of the
> shop cart software. We have Blat 1.8.4 installed and it runs fine from
> the command line. The cgi script runs fine until I submit the order then
> I get the error "Can not send mail. Please check mailer specification".
>
I think that Sendmail only works on UNIX. It wont work on WinNT. Maybe that
is the problem?!?
------------------------------
Date: 14 Aug 1999 01:19:34 GMT
From: Tom Mornini <tmornini@netcom9.netcom.com>
Subject: Re: Database Connection Pooling with Perl
Message-Id: <7p2g76$27k@dfw-ixnews21.ix.netcom.com>
Dave Ortman <dortman@my-deja.com> wrote:
: I'm working on a project which utilizes Perl to speak to an Oracle
: database. There were hope of implementing some sort of connection
: pooling to speed up data access. I've searched a good portion of posts
: on this group, as well as various Perl sites, but haven't been able to
: find any examples of connection pooling. Could anyone point me to any
: such samples? I'd hate to reinvent the wheel...
If you happen to be doing this for a web project, you might want to look
into Apache/mod_perl/Apache::DBI
-- Tom Mornini
-- InfoMania
------------------------------
Date: 13 Aug 1999 18:31:07 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: Fastest form of an 'if'
Message-Id: <7p2gsr$eho$1@shell1.ncal.verio.com>
Andrew Fry <andrewf@beausys.freeserve.co.uk> writes:
>In article <7p12ei$sc4$1@lublin.zrz.tu-berlin.de>, Anno Siegel
><anno4000@lublin.zrz.tu-berlin.de> writes
>>Andrew Fry <andrewf@beausys.freeserve.co.uk> wrote in comp.lang.perl.misc:
>>>In article <slrn7r79p4.e7v.abigail@alexandra.delanet.com>, Abigail
>>><abigail@delanet.com> writes
>>>>Andrew Fry (andrewf@beausys.freeserve.co.uk) wrote on MMCLXXI September
>>>>MCMXCIII in <URL:news:gIL3XCAjNes3EwAE@beausys.freeserve.co.uk>:
>>>>{} Which of these 3 forms of 'if a then b' is faster ?...
>>>>{} 1. if (a) { b; }
>>>>{} 2. b if (a);
>>>>{} 3. a && b;
>>>>{} ... or isnt there enough in it to worry about ?
>>>>
>>>>If you are kept awake at nights worrying about such things, consider
>>>>removing Perl from your system, and start using C, or perhaps assembler.
>>>>
>>>>Abigail
>>>
>>>What a bloody stupid remark. Up to your usual standard.
>>>
>>>I was just curious, that's all.
>>
>>So benchmark it. Why bother the newsgroup? It's not *that*
>>interesting.
>>
>>Anno
>
>My, what a sarcastic, unhelpful, miserable ... and utterly patronising
>... bunch you are! (Well, a few of you...)
>Do you own this newsgroup ? No, you dont! Is it for the sole purpose of
>the gurus to discuss 'interesting' issues ? No, it isnt!
>
Hm... Are you telling them they shouldn't post articles here telling
you you shouldn't post articles here?
How are your protests any different from theirs? If they should
ignore your "uninteresting" questions, why aren't you ignoring their
"unhelpful" responses?
-Greg
--
::::::::::::::::::: Greg Andrews gerg@wco.com :::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
------------------------------
Date: 13 Aug 1999 18:24:16 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: How to delete an element from an array
Message-Id: <7p2gg0$e9t$1@shell1.ncal.verio.com>
Ala Qumsieh <aqumsieh@matrox.com> writes:
>
>QuestionExchange <USENET@questionexchange.com> writes:
>
>> > Could someone please let me know if it is possible to delete an
>> > element from an array in perl?
>> > @array = ("one","two and three",4,"five");
>> > how do I delete '4' and be left with...
>> > @array = ("one","two and three","five");
>> > Thanks in advance,
>> > Dico
>>
>> splice(@array, 2, 1);
>> This removes 1 element at offset 2
>> (counting from 0).
>
>Yes, but this assumes that you know exactly the offset of the element
>you want to remove, which is not necessarily evident.
>
Then the question was poorly phrased.
The question that was asked was "How to delete an element from an array",
not "How to find the element in an array that I want to delete, then
how to delete it."
-Greg
--
::::::::::::::::::: Greg Andrews gerg@wco.com :::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
------------------------------
Date: 13 Aug 1999 21:52:02 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: i cann't read and write at the sametime
Message-Id: <slrn7r9iu1.aik.elflord@panix3.panix.com>
On Fri, 13 Aug 1999 20:19:50 -0400, JCEtek wrote:
>i've openned the file with +<, +> and +>>, i can read but cann't write. >
>overwrites. is there a way to open a file so i can finded something and
>rewrite just that line.
Unless it's a huge file, you can copy it to a backup ( a good idea in
any case ), and read from the backup file while writing to the new file.
BTW, +< is working for me. For example :
open (F,"+<foo");
seek (F,10,1);
print F "\n***blah***\n";
close F;
What platform are you on ?
--
Donovan
------------------------------
Date: Sat, 14 Aug 1999 01:15:37 GMT
From: id-est@home.com (Id Est)
Subject: Re: Nastiness contrary to the spirit of perl?
Message-Id: <slrn7r9gnc.5nn.id-est@erato.bigredrockeater.com>
>So, when I tell you to Read the Fine Manual, or Perlfaq4, I'm picking
>on you? Interesting...
telling somebody to RTFM isn't bullying, but spewing pompous drek like the
following is something quite different ...
>> @@ I have a PERL script that does different actions based on the argument
>The language isn't called PERL. Please read the FAQ and spell the
>language correctly.
-
>> Does anyone have an example using ADO where you prepare an insert cusor,
>> then insert rows, then close the cursor?
>I highly doubt you can prepare insert cusors and insert rows with an
>old soccer team.
>> I am inserting to a SQLServer 7.0 database.
>Very interesting. What colour is your database? How long ago did you
>get it? Did you get any free airmiles with it? Does it play nice with
>the kids? How often do you need to feed it? Also in wintertime? Can
>it talk? Does the interface to the fridge work as the advertisement
>said? How is the after support?
-
>> I am newcomer to Perl, so if you're don't wish to answer to same stupid
>> questions again and again, don't read any furhter.
>Too late. You already posted it. By posting it to this group, you are
>entitled to be flamed.
>^^^^^^^^^^^^^^^^^^^^^
-
>> Is it possible to tell a browser to download a file and redirect the browser
>> to another URL, or in failing that, open a new window that prompts the
>> download and send the original window to a new URL?
>is it possible to tell a penguin to catch a fish and redirect the penguin
>to another iceberg, or in failing that, man a new ship that starts the
>fishing and send the original ship to a new iceberg?
>Your question isn't only poorly phrased, it shows a lack of knowledge
>on how the web works. But most of all, it's completely off topic here.
>Go away.
-
>> and trim the string if inclosed by the specified character, otherwise leave
>> it alone? Perhaps some niffty regular expression.
>Perhaps. Did you bother looking at the regex manpage? Did you try writing
>any code? Did you look at the FAQ, that explains how to do this for spaces?
>Or are you just looking for someone who gives you the answer, without you
>doing anything?
-
>> But (for reasons too long to explain) I must call this file
>> something.html! I can't call it something.cgi or something.pl!
>And why should *we* care? Ask your sysadmin.
-
>> I can't change its name to file.cgi .
>Oh, how sad. You don't have the manual, or are you missing some keys on
>your keyboard? Perhaps you can buy a case of beer, offer that to your
>sysadmin, and have your sysadmin assist you in changing the filename?
-
and so on endlessly ad nauseum ...
sure looks like bullying to me.
------------------------------
Date: Fri, 13 Aug 1999 18:22:13 -0700
From: Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com>
Subject: Re: Passing associative arrays to CGI scripts (perl)
Message-Id: <37B4C4C5.FA798016@cisco.REMOVETHIS.com>
["Joseph R. Wyrembelski" wrote:
> Using forms, how would I go about passing the three
> parameters
> $number -- which is a scalar
> *arrayOne -- which is an associative array
> *arrayTwo -- which is also an associative array
>
> Currently, I am trying (and would like to) use
> <form method=POST action="script.pl?">
> <INPUT TYPE=hidden NAME= userData VALUE= *userData>
> <INPUT TYPE=hidden NAME= pathData VALUE= *pathData>
> <input type="text" name="number" size="20">
> <input type=Submit Value="Do Script">
> </form>
>
I don't think there is a way to do what you are attempting above.
You will see that the string "*userData" will get sent to the server
side script instead.
> but when it gets to the script and executes the code:
>
> %input = ();
> &ReadParse(*input);
> local($number) = $input{'number'};
> local(*userData) = $input{'userData'};
> local(*pathData) = $input{'pathData'};
>
> the two associative arrays appear empty though the number appears
> fine!
>
This is just as expected.
> I have read something somewhere about ".. multivalued [somethings] are
> separated in the query string by \0.." but I am not sure if that is
> correct or relevant.
Yes. There is a reference to this stuff made by Lincoln Stein in the
CGI.pm
documentation. He describes this when discussing usage of Vars() where you
can access
the entire parameter list as a hash in which the keys are the names of the
CGI parameters,
and the values are the parameters' values. But when some multivalued
parameters are
present then their values are returned separated with null character. You
should
split this scalar at the null character to get at the individual values. A
point
to note here is that the null character glue is used only the module and
the
parameter is not coded as such when the FORM is generated/submitted.
I tried this without any success.
$special_string = join "\0", %hash;
and put this inside the FORM --
<form method=POST action="script.pl?">
<INPUT TYPE=hidden NAME= userData VALUE=\"$special_string\">
etc because of the usage of "\0" character.
You can anyway use some other character as the glue in this case and
make this thing work. ( eg. use the character | ). After this value is
recieved
by the script you can split it back and reconstruct your hash userData.
This
scheme can work for arrays also.
--Makarand
------------------------------
Date: 13 Aug 1999 19:07:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl and I18N
Message-Id: <37b4c159@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
eric@logrus.berkeley.edu (Eric van Bezooijen) writes:
:Can perl handle Unicode ? MultiByte ? This is all on UNIX ...
Somewhat. There's a "perllocale" manpage and a "utf8" manpage in the
very most recent versions of Perl. Get the developer release (5.005_60),
if only to look at the docs.
--tom
--
MSDOS was created to keep idiots away from Unix
------------------------------
Date: Fri, 13 Aug 1999 21:52:05 -0400
From: "markd" <mark_and_kylie@email.msn.com>
Subject: using the cd command in perl on Windows98
Message-Id: <e8cxggf5#GA.489@cpmsnbbsa02>
Hi
Quick question:
I've just installed the ActivePerl distribution of perl on my Win98 PC,
using the djgpp unix emulation utilities.
I wrote a program with the line
system("cd $directory");
in it, and am getting the error message
Can't spawn "cd": No such file or directory (ENOENT) at test.pl line 4.
ie, the program can't find or execute the cd command.
There is no cd.exe in the djgpp unix utilities bundle, so I'm wondering if
that's the problem, or if i should be able
to somehow execute the DOS cd command, or it there's something else I'm
overlooking.
I've checked the WIN32 perl FAQ, but it doesn't seem to address anything
like this.
Mark
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 515
*************************************