[15885] in Perl-Users-Digest
Perl-Users Digest, Issue: 3298 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 9 00:05:37 2000
Date: Thu, 8 Jun 2000 21:05:10 -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: <960523509-v9-i3298@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 8 Jun 2000 Volume: 9 Number: 3298
Today's topics:
Re: Active Directory and Perl <peter@lberghold.net>
Re: Anoymous hash slices <inaba@sdd.tokyo-sc.toshiba.co.jp>
Re: Content-type header to Set Cookie (Tony L. Svanstrom)
Data miner (Dave King)
Re: Database program (SASprgmr)
Re: file access (SASprgmr)
Re: Function Which Saves a Passed-in Help Desk HTML For surens@attglobal.net
Re: getting rid of slashes.... <abe@ztreet.demon.nl>
Re: Larry Rosler interview on perl.com! <uri@sysarch.com>
Re: Larry Rosler interview on perl.com! <dan@tuatha.sidhe.org>
Re: Larry Rosler interview on perl.com! (Neil Kandalgaonkar)
Re: No offense but Larry Wall should do the maths !! <htp@mac.com>
Re: No offense but Larry Wall should do the maths !! <TheEx0rcist@fanclub.org>
Re: No offense but Larry Wall should do the maths !! <red_orc@my-deja.com>
Re: No offense but Larry Wall should do the maths !! <TheEx0rcist@fanclub.org>
Re: No offense but Larry Wall should do the maths !! <TheEx0rcist@fanclub.org>
Re: No offense but Larry Wall should do the maths !! <TheEx0rcist@fanclub.org>
Re: No offense but Larry Wall should do the maths !! <TheEx0rcist@fanclub.org>
Re: No offense but Larry Wall should do the maths !! <Jonathan.L.Ericson@jpl.nasa.gov>
Re: Oracle DBD (John D Groenveld)
Re: Perl and memory consumption <dan@tuatha.sidhe.org>
Re: Perl and memory consumption <dan@tuatha.sidhe.org>
Re: Problem with perl DBI & access (SASprgmr)
Re: Shopping Cart Code Critique <jamesht@idt.net>
Re: string help needed (Peter J Scott)
Re: URI encoded parameter for CGI.pm problem. crrjohnson@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Jun 2000 02:49:04 GMT
From: Peter L. Berghold <peter@lberghold.net>
Subject: Re: Active Directory and Perl
Message-Id: <AWY%4.119863$R4.721517@news1.rdc1.nj.home.com>
In article <8hhc1f$olj$1@nnrp2.deja.com>, theowood@my-deja.com wrote:
> Does anyone have sample Perl code for accessing
> objects (ie. users, groups) in Microsoft's Active
> Directory?
As I understand it you can use the LDAP protocol to talk to M$/AD. If that is the case
then you should be able to use the LDAP modules from CPAN.
--
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Peter L. Berghold http://www.berghold.net
Peter@Berghold.Net Linux Bigot at Large
"Linux renders ships... Windows NT renders ships useless..."
------------------------------
Date: 09 Jun 2000 11:09:42 +0900
From: Inaba Hiroto <inaba@sdd.tokyo-sc.toshiba.co.jp>
Subject: Re: Anoymous hash slices
Message-Id: <7s7lbzfvvd.fsf@sdd.tokyo-sc.toshiba.co.jp>
Larry Rosler <lr@hpl.hp.com> writes:
> > > or, differently,
> > >
> > > @array = map { my @a = split /\|/;
> > > { cost => $a[0], flavor => $a[1], texture => $a[2] } } @lines;
> The original poster asked, in effect, if he could do this list-of-hashes
> initialization without using named temporaries. I showed three
> different types of named temporaries, but still don't see an efficient
> solution that uses none.
How about this?
@array = map sub { { cost => $_[0], flavor => $_[1], texture => $_[2] } }
->(split /\|/), @lines;
------------------------------
Date: Fri, 9 Jun 2000 03:15:34 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Content-type header to Set Cookie
Message-Id: <1ebxvhi.10owuzc1w6wg90N%tony@svanstrom.com>
Eric Bohlman <ebohlman@netcom.com> wrote:
> Norbert Wienholz (norbert@NOSPAMcontrex-us.com) wrote:
> : But the side effect of not relying on Black Boxes for my programming is
> : that I now know more about Perl & CGI than if I'd have just read the
> : documentation of some modules and used them without understanding what
> : they do.
>
> Perl modules are not Black Boxes. They are Open Source. They are pieces
> of code that you can *read*. Once you understand a module's interface you
> may, if you so desire, gain understanding of that module's implementation
> as well. You may be used to the idea of locked-up commercial libraries
> offered for other languages. Your POV is quite valid when talking about
> such things. But Perl modules are Not Like That. They are pieces of
> debugged, tested and peer-reviewed code. When you read the source to a
> module as widely used as CGI.pm, you will learn a lot of good habits. You
> will *not* learn bad habits that you will later have to unlearn, whereas
> if you try to learn purely by trial and error, you most likely *will*
> learn things that you will later have to unlearn.
>
> Use the Source, Luke.
Would like to add a lil thing... Norbert, once you've understod that
there's no magic connection between Perl (or anyother language) and
CGI/the web/whatever then you'll be able to see that the task and
structure of it is independant of how you go about doing it. So instead
of not wanting to use CGI.pm you should have taken a look at the specs
for http (and cookies), to learn what they should (ie have to) look
like.
/Tony
PS but as most people that have been around here awhile and bored enough
to read what I've written knows I am anti-CGI.pm to, guess it's a matter
of not wanting to grow up. ;-)
--
/\___/\ Who would you like to read your messages today? /\___/\
\_@ @_/ Protect your privacy: <http://www.pgpi.com/> \_@ @_/
--oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
DSS: 0x9363F1DB, Fp: 6EA2 618F 6D21 91D3 2D82 78A6 647F F247 9363 F1DB
---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
\O/ \O/ ©1999 <http://www.svanstrom.com/?ref=news> \O/ \O/
------------------------------
Date: Fri, 09 Jun 2000 01:41:33 GMT
From: KingDWS@Home.Com (Dave King)
Subject: Data miner
Message-Id: <39414910.24844291@24.2.10.79>
I' hoping to avoid reinventing the wheel so I'm hoping to find
something someone else has done or found. What I'm looking for is a
script for retrieving the mail list archieves from a site such as
egroups.
You can of course get each and every message one at a time but
if you have a few thousand you want to sort through this can take
a bit of time. If you could download selected messages or how many
you want say 1 to 1000 and save locally. Searching through them would
be much faster.
I know it can be done, I've seen the results. Does anyone have any
ideas if someone has made the script available?
Dave
------------------------------
Date: 09 Jun 2000 03:55:06 GMT
From: sasprgmr@aol.com (SASprgmr)
Subject: Re: Database program
Message-Id: <20000608235506.26416.00002207@ng-fh1.aol.com>
How about Postgress? That's free, and instead of using the DBI module, you use
Pg. Postgress also gives easy access to error messages and return codes. I just
finished converting my programs from MySQL to Postgress. Took me 4 days to
convert about 30-40 web programs and debug them, load data and test them. We're
still early in the test, but speed seems comparable to MySQL.
www.postgresql.org in case you're curious.
Jay
------------------------------
Date: 09 Jun 2000 03:50:31 GMT
From: sasprgmr@aol.com (SASprgmr)
Subject: Re: file access
Message-Id: <20000608235031.26416.00002205@ng-fh1.aol.com>
Get the "Perl Cookbook" from O'Reilly. It addresses this problem (and many
others) quite well. I couldn't do my job without it.
Jay
(working at Abbott Laboratories, the drug giant)
------------------------------
Date: Thu, 08 Jun 2000 23:14:44 +0200
From: surens@attglobal.net
Subject: Re: Function Which Saves a Passed-in Help Desk HTML Form to a file
Message-Id: <39400CC4.9C58C6FE@attglobal.net>
1-) Put the following line at beginning of your helpdesk.cgi
use CGI::Carp qw(fatalsToBrowser);
with this, you will see the reason in your web browser which, I believe,
will be a permission problem,
then,
2-) Change the my $gbdata to following
my $gbdata="/tmp/guestbook";
And run the program, it should work now (helpdesk.sem should be under
the /tmp also)
Now it should work
3-) Read the next 'hour' in the book.
A;-)
teddy9542@my-deja.com wrote:
>
> Hi, I found a code in Perl/CGI book, which saves information passed
> from a HTML form into a file (eg a text file). I am having trouble
> getting it to work. I don't receive any error messages either. Any
> suggestions would be greatly appreciated
>
> # This function saves a passed-in help desk HTML form to a file
> # ($gbdata is the name of the file e.g. comments.txt)
> sub save {
> get_lock();
> open(GB, ">>$gbdata") || die "Cannot open $gbdata: $!";
> print GB "name: ", param('name'), "\n";
> print GB "type: ", param('probtype'), "\n";
> print GB "problem: ", param('problem'), "\n";
> close(GB);
> release_lock();
> }
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 09 Jun 2000 03:07:09 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: getting rid of slashes....
Message-Id: <84f0ksc57g288utv8d7us50rafqshae6os@4ax.com>
On Thu, 08 Jun 2000 16:25:50 +0200, Gert <register_ms@hotmail.com>
wrote:
> Hi,
Hi,
>
> Everything works like a charm on my Win32 box, except for one thing.
> It is inserting an <img> tag like: <img src="http://id001s/we/1///1.jpg"> (Notice the extra
^^
Not whith the code you show us.
> slashes.)
> I did my very best to delete them. If I do nothing i get 3 slashes, if I try to remove one I get 2, if I try to remove 2
> I get 3 slashes again, and if I try to remove all three there are 4 slashes in the tag.
> Any of you experts can help me?
> It would be much appreciated!
>
> Gert.
>
> P.S. The script is below...
>
> #!c:\perl\bin\perl.exe
>
> $picdir = "G:/WE/"; #Originally the pics were located somewhere else, but I moved them so the
^
> paths are identical now. I
> #should remove one....
> $webdir = "G:/WE/";
> $url = "http://id001s/WE/$num/";
^^^ ^^^^
Now where did $num get a value? This would have been caught by perl if
you had turned on warnings.
(meanwhile, there's two slashes at the end of $url)
> $picnum=0;
>
> for ($num=1; $num <=5; $num++) {
> @pics = glob("$picdir/$num/*\.jpg");
^^^^^^^^^^^^^^^^^^^^
As $picdir ends with a slash, the begining of that interpolates to:
G:/WE//$num...
and glob() will return that double slash in each $pic foreach (@pics)
so get rid of that slash.
> foreach $pic (@pics) {
> $picnum++;
> print "Processing $pic................";
> # Hey, I want something to look at while it's doing it's thing....
> $pic =~ s/G:\/WE\///;
$pic =~ s!$picdir!!o;
Use other delimeters for the regex if slashes are in your pattern.
(meanwhile $pic still has a leading slash)
> # If I try to take out the slashes in the first regex, it won't remove anything....
> $pic =~ s/\/\///;
Why bother, this tries to fix a bug in your program, which shouldn't
have been there in the first place. And $pic doesn't have two
consecutive slashes (they where trailing $url)
> # You would think I would have gotten all three slashes out now, but noooooo.....
> open(NEWFILE, ">$webdir/$picnum.htm");
And I would hope that open was successful, _always_ check the result of
an open:
open NEWFILE "> $webdir$picnum.htm" or
die "cannot open '$picnum.htm': $!";
...
> print NEWFILE "<div align=\"center\"><IMG src=\"$url$pic\"></div></TD>";
^^^^^^^^
And that's where your three slashes come together.
--
Good luck,
Abe
------------------------------
Date: Fri, 09 Jun 2000 01:58:07 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <x7u2f3aa4y.fsf@home.sysarch.com>
>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
LR> A relevant bit of history: I am not talking about a formal definition.
LR> Such was attempted for PL/I (named for Vienna, Virginia), was about 700
LR> pages long, and was impenetrable and unusable. A useful definition
having worked with that very pl/i spec i can testify to its
unusability. its meta language is the pits and it has more caveats than
bugs in winblows2k. if perl were to get that, i would stop using perl.
LR> should be accessible to implementers and to programmers. Here is a
LR> quote from 'Rationale for American National Standard for Information
LR> Systems -- Programming Language -- C':
LR> While more formal methods of language definition were explored, the
LR> Committee decided early on to employ the style of the Base Document
LR> [K&R Appendix A: C Reference Manual]: Backus-Naur Form for the
LR> syntax and prose for the constraints and semantics. Anything more
LR> ambitious was considered to be likely to delay the Standard, and
LR> to make it less accessible to its audience.
LR> Possibly no such definition is possible for Perl, but I seriously doubt
LR> it.
ilya has pointed out many places where the functionality of perl is not
well defined and should/could be. we can empirically determine what will
happen but it is nice to have an accurate spec for some of the
cases. the docs are very good compared to many other projects but they
are not accurate specs. we have seen many threads here on things such as
execution order of expressions in lists, rounding issues, arcane syntax
wierdness, etc. having a spec to compare against would be useful if it
weren't too bloated or overwritten. the only thing used to test perl is
its own tests which are not comprehensive enough for language purists.
but i doubt this will happen as there is too much other stuff to do
which is more fun. the academic types who like this sort of thing won't
go near perl in any way, shape or form.
and your interview just got slashdotted (which means i am slashdotted by
proxy :-). seems the standards and perl idea will get propogated for a
while. let's watch for the fallout.
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: Fri, 09 Jun 2000 02:45:00 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <MSY%4.106864$hT2.426465@news1.rdc1.ct.home.com>
Larry Rosler <lr@hpl.hp.com> wrote:
> Perl is defined by a single official open source. It is a deterministic
> computer program. The most arcane DWIMmery is deterministic, hence
> definable. Without looking, I'll bet there isn't a single call to
> rand(3C) anywhere in the perl source.
And you'd probably be wrong. (Depending on what Configure found, of
course) How else do you think the rand operator generates its data? :)
Dan
------------------------------
Date: 9 Jun 2000 03:40:56 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <8hpp08$t7i$1@newsflash.concordia.ca>
(Larry Rosler, speaking in the interview)
>:LR: I believe that it does, in order to increase its acceptability.
>:Many organizations either cannot or will not endorse the use of
>:unstandardized languages in their business-critical activities.
Pardon my ignorance of standardization but, which organizations are
those?
I am wondering how standardized things like Visual Basic are. (Maybe
it is -- although I sincerely doubt it! Any independent implemenations
of Visual Basic yet?) Yet many companies seem willing to trust it
with their business-critical activities.
I am not arguing that what Microsoft does is a model to follow, but
I don't see many businesses carping about standardization.
--
Neil Kandalgaonkar
neil@brevity.org
------------------------------
Date: Fri, 09 Jun 2000 10:39:56 +0930
From: Henry <htp@mac.com>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <htp-791FB7.10395609062000@news.metropolis.net.au>
In article <8hpc6b$buc$1@news6.isdnet.net>, "TheEx0rcist"
<TheEx0rcist@fanclub.org> wrote:
> Why isn't "print int(rand*3)" the same as "print int(rand*3)" ??? Isn't
> multiplication supposed to be _always_ commutative?
>
> I'm using Perl 5.6.0 on Win2k
^^^^^
|
Ah, here's your problem ----+
You're using a brain-dead operating system!
Try the official workaround for brain-dead operating systems:
---
$myRand = rand();
print int($myRand*3),"\n",int(3*$myRand);
---
Enjoy!
Henry.
------------------------------
Date: Fri, 9 Jun 2000 03:19:22 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hpglu$1ev9$1@news4.isdnet.net>
> Because you are using a random number?
Who said that?
No mention of it in the docs!
> perldoc -f srand
> [...]
> C:\>perl -w
> srand(123);
> [...]
> This is perl, version 5.005_03 built for MSWin32-x86-object
"perldoc-f srand"?
Did you read the actual docs before asking people to read it??
Quoting :
qq[
In fact, it's usually not necessary to call `srand' at all,
because if it is not called explicitly, it is called implicitly
at the first use of the `rand' operator. However, this was not
the case in version of Perl before 5.004, so if your script will
run under older Perl versions, it should call `srand'.
]
So why in the world are you using srand when you got Perl 5.005_3 (>5.004)
installed on your system??
Also did you read my actual message??
I'm using Perl 5.6.0 on Win2k and rand*4 is absolutely not the same as
4*rand
No matter rand is a random number : IT IS A NUMBER and WITH A and B BEING
NUMBERS :
A * B has always been equal to B * A
Ask your maths teacher if you don't believe!
Like I said Larry Wall should do the maths. He is not that bright
obviously!!
------------------------------
Date: Fri, 09 Jun 2000 01:11:35 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hpg7s$tr2$1@nnrp1.deja.com>
In article <8hpc6b$buc$1@news6.isdnet.net>,
"TheEx0rcist" <TheEx0rcist@fanclub.org> wrote:
> Why isn't "print int(rand*3)" the same as "print int(3*rand)" ??? Isn't
> multiplication supposed to be _always_ commutative?
maybe because rand does not have the same value twice in a row?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 9 Jun 2000 03:32:06 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hphdk$eac$1@news6.isdnet.net>
> > I'm using Perl 5.6.0 on Win2k
> ^^^^^
> |
> Ah, here's your problem ----+
>
> You're using a brain-dead operating system!
>
> Try the official workaround for brain-dead operating systems:
Stop insulting my OS will you?
I tried the same thing on Linux Redhat 2.2.10 Kernel, Perl 5.005_02 and it
did the very same thing!
------------------------------
Date: Fri, 9 Jun 2000 03:34:24 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hphhv$hon$1@news3.isdnet.net>
> maybe because rand does not have the same value twice in a row?
Nothing to do with it
I launched the "print int(3*rand)" script like 10 times in a row and it
printed values from 0 to 2
Did the same thing for "print int(rand*3)" and it always gave 0
------------------------------
Date: Fri, 9 Jun 2000 03:43:49 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hpi3k$hvl$1@news3.isdnet.net>
> There *was* meant to be a smiley in there somewhere wasn't
> there?
:D
------------------------------
Date: Fri, 9 Jun 2000 03:44:50 +0200
From: "TheEx0rcist" <TheEx0rcist@fanclub.org>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <8hpi5h$i08$1@news3.isdnet.net>
> Yes, but there is no multiplication in the first example.
>
> Try it again with '+' instead of '*'. You will get a perhaps more
> useful warning than the one with '*'. (Please don't tell me you posted
> snippets like that without testing them with warnings on!).
>
> Hint for the truly lazy: Try it again with rand() instead of just rand.
THANK YOU
Now I understand my mistake
------------------------------
Date: Thu, 08 Jun 2000 18:03:13 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <39404251.B7EFCD51@jpl.nasa.gov>
TheEx0rcist wrote:
> Why isn't "print int(rand*3)" the same as "print int(3*rand)" ??? Isn't
> multiplication supposed to be _always_ commutative?
Actually this is an anomoly of the perl parser. Observe:
$ perl -e 'print *3'
*main::3
$ perl -e 'print 1*3'
3
In Perl, * can be the multiplication operator or the typeglob type
prefix (see perldata). Perl parses your first example as:
print(int(rand(*3)))
and your second example as:
print(int(3*rand()))
Perl trys to DWIM (Do What I Mean), but sometimes it guesses wrong.
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
------------------------------
Date: 8 Jun 2000 21:44:53 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Oracle DBD
Message-Id: <8hpi6l$qap$1@grolsch.cse.psu.edu>
In article <393FCA6F.C3992FF6@hivolda.no>,
Ole Christian Eidheim <eidheim@hivolda.no> wrote:
>I must say that I'm abit tired of installing the whole Oracle
>server-package just to get the libraries and header files I need to
You're preaching to the choir. Complain to your sales rep.
Check out the dbi-users' mailing list archive, work-arounds for
the 8.1.x Java problem have been posted there.
Installing the server (without creating the database objects) is
the safest way to go. Again, complain to Oracle, there's a lot they
could to do to ease the build of applications against their client
libraries.
John
groenveld@acm.org
------------------------------
Date: Fri, 09 Jun 2000 02:38:29 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl and memory consumption
Message-Id: <FMY%4.106861$hT2.426465@news1.rdc1.ct.home.com>
Joe Kline <jkline@one.net> wrote:
> Guess I just have to get used to a troll (an especially stubborn one)
> just not wanting to give an inch when reason is presented. Just
> another bit of usenet that one has to unfortunately bear.
Compared to some of the more colorful folks from Usenet's past (McElwane
(sp?) from sci.physics anyone?) this is tame.
Dan
------------------------------
Date: Fri, 09 Jun 2000 02:40:50 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Perl and memory consumption
Message-Id: <SOY%4.106862$hT2.426465@news1.rdc1.ct.home.com>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
> On Thu, 8 Jun 2000, Dan Sugalski wrote:
>> Well, there's hope for everyone, and no reason to be rude regardless.
> We're all agog to see just how long your patience lasts out.
My daughter's two, and my son's five. You'd be *amazed* at how much
patience I can muster. :) Free time's another issue entirely, of course...
Dan
------------------------------
Date: 09 Jun 2000 03:48:05 GMT
From: sasprgmr@aol.com (SASprgmr)
Subject: Re: Problem with perl DBI & access
Message-Id: <20000608234805.26416.00002204@ng-fh1.aol.com>
I just did a query similar to that at work
(Clinical drug trials under Food & Drug Administration oversight; you wouldn't
believe the regulations), but we were using MySQL. In the SQL for MySQL the
wildcard (%) had to go on the front or back or both depending on whether you
were searching for the string to be contained in the back, front, or middle of
the field. It worked fine for me.
We were running Perl 5.00504 (?) on a 486/133 using FreeBSD and MySQL db. We've
since switched to an HP-UX running Postgress SQL db. Still no problems, but now
we're using Pg instead of DBI. The only change was that I had to change the
double-quotes which MySQL demanded, to single-quotes which Postgress demands.
Did you check that you're using the correct kinds of quotation marks?
Other than that, the way I see it is the problem is that you're using a
Microsoft product, whose products are notoriously buggy. (Windows GPF messages
anyone?)
Jay
------------------------------
Date: Thu, 08 Jun 2000 21:29:57 -0700
From: James Tolley <jamesht@idt.net>
Subject: Re: Shopping Cart Code Critique
Message-Id: <394072C5.332D032D@idt.net>
Josiah Bryan wrote:
>
> I wrote a small core for a shopping cart for my company.
>
> I would be most appreciative if I could get a detailed critique
> of this script from any and all that would care to. Please
> don't spare any flames
Are you sure about that? When I looked at the code,
I thought for a moment that this was a joke...is it?
Here are four Serious mistakes:
no -wT flags
Just use them. Good for what ails ya.
no 'use strict';
Just use strict! It'll save you a lifetime of debugging.
'require jLIB/cgi-lib.pl'
Is this THE cgi-lib.pl? It's archaic; use CGI.pm instead.
using $ENV{REMOTE_ADDR} for anything important, like session handling.
Due to all the people behind proxies, this is a BAD idea.
(I didn't look at the whole thing, but it sure looked suspicious!)
I didn't bother to look down any further, sorry.
I suggest a healthy diet of O'Reilly books and CGI/Perl FAQs.
hth,
James
------------------------------
Date: Wed, 07 Jun 2000 17:10:11 GMT
From: peter@PSDT.com (Peter J Scott)
Subject: Re: string help needed
Message-Id: <Tlv%4.9439$F9.306331@news1.gvcl1.bc.home.com>
In article <01bfd09a$c9a46b40$cf0114ac@raptor.unitedtraffic.com>,
"D.W." <dpalmeNOSPAM@unitedtraffic.com> writes:
>I have four variables I'm wanting to put in another variable in the following manner
>
>$string = ( [quote here] $lat1 [space here] $lon1[quote here] [space here]
>[quote here] $lat2 [space here] $lon2 [quote here] );
>
>So when I print the statement I get the following result
>
>"41.837050N 87.684965W" "42.270300N 89.063149W"
>
>I want it to print the quotation marks in the string....I'm going to pass
>this to another program....but I've spent three long days trying to figure
>this out to no avail.....
>
>Any help would be appreciated....I'm sure its simple and I'm just not
>thinking of the right way to handle it.
While you can escape double quotes to put them in a double-quoted string
$string = "\"$lat1\" \"$lon1\" \"$lat2\" \"$lon2\"";
it's not as aesthetic as using qq() (man perlop):
$string = qq("$lat1" "$lon1" "$lat2" "$lon2");
Few languages are obliging enough to rearrange their quoting delimiters
to your convenience.
--
Peter Scott
------------------------------
Date: Fri, 09 Jun 2000 03:51:40 GMT
From: crrjohnson@my-deja.com
Subject: Re: URI encoded parameter for CGI.pm problem.
Message-Id: <8hppk7$4me$1@nnrp1.deja.com>
Thanks for your responses.
At first this appeared to be an issue in perl, and I tried escaping out
the ampersand appropriately.
On further testing, I found that Perl was okay debug mode for the cgi
module from the command line works fine, so it <em>is</em> a SSI issue
not Perl as I originally thought.
I have posted a message in alt.www.webmaster to see if someone knows how
to solve it. The documentation for SSI that I have seems to say that it
should work. (Apache web site, O'Rieley Webmaster in a Nutshell, etc)
Thanks again,
Colin.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3298
**************************************