[16563] in Perl-Users-Digest
Perl-Users Digest, Issue: 3975 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 10 11:10:26 2000
Date: Thu, 10 Aug 2000 08:10:16 -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: <965920216-v9-i3975@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 10 Aug 2000 Volume: 9 Number: 3975
Today's topics:
List dir contents in an html file. (Newbie) <mark@mark-spring.com>
Re: List dir contents in an html file. (Newbie) bird_sky@my-deja.com
London £30-35K Perl Programmers Required <c_barnes_ukNOc_SPAM@hotmail.com.invalid>
Re: Newbie questions: What exactly is $_? (Jon S.)
Re: on-the-fly variable <bart.lateur@skynet.be>
Re: Perl mods for MySQL <((>< <yamar420@my-deja.com>
Re: Perl Win32 issues linga@my-deja.com
Problem installing Regexp.pm jknight_30@my-deja.com
Re: problem perl/cgi Apache web server on win 98 Help! <asg@natlib.udm.ru>
Re: Problem using DBI <barbr-en@online.no>
Re: reg expressions - protect html (Randal L. Schwartz)
Re: reg expressions - protect html <care227@attglobal.net>
Re: Sort of a sort problem. (Randal L. Schwartz)
Thanks for your help <jkearmanNO@mindspring.com>
Re: truncate var spaces <amonotod@netscape.net>
Using True Type Fonts with GD module? <samara_biz@hotmail.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Aug 2000 12:09:59 +0200
From: "Mark Spring" <mark@mark-spring.com>
Subject: List dir contents in an html file. (Newbie)
Message-Id: <8mtv0f$7n5$1@blue.nl.gxn.net>
Hi all,
I want a bit of code to read the contents of a directory
and then produce a pull down <select> menu in a HTML page,
If the page visitor clicks on an option in the list then a variable is
assigened to another value and passed onto the next script.
Now I know how to open the dir and to close it,
but I have not the foggiest how to list the content (I know how to split the
extention etc.).
I dont want a piece of code, I want to try it for myself, .. but I need some
pointers
idea's and tips (yes, I have checked the man pages)
TIA,
Mark
--
***************************************************************
*"Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning." (Rich Cook)
***************************************************************
------------------------------
Date: Thu, 10 Aug 2000 10:50:29 GMT
From: bird_sky@my-deja.com
Subject: Re: List dir contents in an html file. (Newbie)
Message-Id: <8mu1dl$bmn$1@nnrp1.deja.com>
I don't know if what i am writing is a answer to what you said, but try
using
readdir(DirHandle);
this will give you a list having contents of the directory.
In article <8mtv0f$7n5$1@blue.nl.gxn.net>,
"Mark Spring" <mark@mark-spring.com> wrote:
> Hi all,
>
> I want a bit of code to read the contents of a directory
> and then produce a pull down <select> menu in a HTML page,
> If the page visitor clicks on an option in the list then a variable is
> assigened to another value and passed onto the next script.
>
> Now I know how to open the dir and to close it,
> but I have not the foggiest how to list the content (I know how to
split the
> extention etc.).
>
> I dont want a piece of code, I want to try it for myself, .. but I
need some
> pointers
> idea's and tips (yes, I have checked the man pages)
>
> TIA,
>
> Mark
>
> --
> ***************************************************************
>
> *"Programming today is a race between software engineers striving to
build
> bigger and better idiot-proof programs, and the Universe trying to
produce
> bigger and better idiots. So far, the Universe is winning." (Rich
Cook)
>
> ***************************************************************
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 07:12:56 -0700
From: checker <c_barnes_ukNOc_SPAM@hotmail.com.invalid>
Subject: London £30-35K Perl Programmers Required
Message-Id: <325cbd74.235e50ad@usw-ex0104-031.remarq.com>
London £30-35K Perl Programmers Required
http://www.hotrecruit.co.uk ,a rapidly expanding Internet
recruitment advertising company require Perl programmers to join
our team.
Extensive experience required of Perl and MySQL on UNIX.
Please contact chrisb@hotrecruit.co.uk
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: Thu, 10 Aug 2000 15:00:30 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: Newbie questions: What exactly is $_?
Message-Id: <3992c151.5190914@news.earthlink.net>
On Wed, 09 Aug 2000 21:03:06 GMT, SPAM+indigo@dimensional.com (Tim)
wrote:
>jonceramic@nospammiesno.earthlink.net (Jon S.) wrote in
><3991accf.21565733@news.earthlink.net>:
>
>>Ok then, here's a newbie followup question...
>>
>>Other than as an easier way to type things in and keep them looking
>>tidy, is there any particular benefit or reason to use $_ or @_ in
>>certain situations?
>
>Nope.
<rest of the good stuff snipped>
Thanks Tim.
Jon
------------------------------
Date: Thu, 10 Aug 2000 13:08:56 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: on-the-fly variable
Message-Id: <e5a5pskp8t1q32osfculuj53mvd5cp1qq9@4ax.com>
Andy wrote:
>Sorry for made you confusing, but actually, I want to write a shopping cart
>program that can calculate the total price when the user add the items to
>the shopping cart. And the total price will calculating and updating
>frequently.
>And I don't want to use the cookie, and thanks for your help!
Simply recalculate the total every time.
All you need to store is the selected items themselves, but you can't
build a shopping cart system without that.
Storing the intermediate total is useless, because you'll have to fetch
the description of the items, to put into your page, and the number of
items for each articel, anyway. So pulling out the price as well and
adding to a total, starting from scratch every time, is an "overhead"
not even worth mentioning at all.
--
Bart.
------------------------------
Date: Thu, 10 Aug 2000 13:55:25 GMT
From: <((>< <yamar420@my-deja.com>
Subject: Re: Perl mods for MySQL
Message-Id: <8muc8a$jj6$1@nnrp1.deja.com>
Thanks for the info, I have one more question though. Everytime I try
to untar the Mysql bin file it tells my it has a checksum error. After
looking around I found notes stating that I needed to load GNUtar. I
have since then installed it, but still have problems untarring the
file. Does anyone know how to correct this ? Thanks. Yamar
In article <slrn8p3rd4.uec.jsd@cluttered.com>,
jsd@cluttered.com wrote:
> On Wed, 09 Aug 2000 20:30:54 GMT, <((>< <yamar420@my-deja.com> <>
wrote:
> >Can someone tell me the correct mod to load for Solaris and
MySQL ;perl;
> >there seems to be a few ;
> >
> >DBI-1.13.tar.gz
>
> this is the database "super module". it uses a DBD::something sub
module
> to do all the actual dirty work. the brilliant thing here is that if
you
> suddenly decide to chuck MySQL and go Oracle, you don't have to
rewrite
> most of your perl code, because DBI abstracts away the details of the
> underlying database as much as possible.
>
> >Msql-Mysql-modules-1.2209.tar.gz
>
> yes, you need this. this is the sub module that does all the actual
> talking to the database. DBI uses it.
>
> >Data-Dumper-2.101.tar.gz
>
> handy, but not required.
>
> >KAMXbase1.0.tar.gz
> >Convert between '.dbf' files and MySQL tables. Perl module written by
> >Pratap Pereira
>
> well, if you are migrating dbf files, then yeah, this would be
> useful. if you're starting from scratch, it is not required.
>
> >Data-ShowTable-3.3.tar.gz
>
> optional.
>
> >thanks... I want to run Apache and MySQL , and use a perl and CGI
script
> >to access my DB..
>
> all you need for that is DBI and the Msql-Mysql-modules.
>
> -jsd-
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 14:05:31 GMT
From: linga@my-deja.com
Subject: Re: Perl Win32 issues
Message-Id: <8mucr7$k1s$1@nnrp1.deja.com>
use a shareware program called perl2exe
In article <5ZBh5.37688$B33.101374@dfw-read.news.verio.net>,
"Mokoto Mizuhara" <zappa@inetnow.net> wrote:
> Sorry if this is off topic but I have been trying to solve this
problem for
> a week with no success.
>
> I am trying to compile a small Perl program under Winnt. Perlcc is
> generating the C code but it fails during the build with the following
> error:
>
> D:\adtserver2.1>perlcc adtserver.pl
>
> ----------------------------------------------------------------------
------
> ----
>
> Compiling adtserver.pl:
> ----------------------------------------------------------------------
------
> ----
>
> Making C(adtserver.pl.c) for adtserver.pl!
> C:\perl\5.00503\bin\MSWin32-x86\perl.exe -IC:\perl\5.00503
\lib/MSWin32-x86 -
> IC:\
> perl\5.00503\lib -IC:\perl\site\5.00503\lib -I. -MO=CC,-
oadtserver.pl.c
> adtserve
> r.pl
> adtserver.pl syntax OK
> Compiling C(adtserver) for adtserver.pl!
> Couldn't open !
>
> D:\adtserver2.1>
>
> This happens with the Perl binary distribution at
http://www.perl.org/CPAN .
> I also tried building the sources and using them but I had the same
problem.
> However, I am able to compile this same program under Linux using the
same
> version of Perl (version 5.005_03) with no problems. Any help would be
> greatly appreciated.
>
> Thanks,
> -Mokoto Mizuhara
> zappa@inetnow.net
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 13:19:48 GMT
From: jknight_30@my-deja.com
Subject: Problem installing Regexp.pm
Message-Id: <8mua5e$hn5$1@nnrp1.deja.com>
After running Makefile.PL and make I get the following error:
-----------------------------------------------------
cc-1020 cc: ERROR File = Regexp.xs, Line = 309
The identifier "curpm" is undefined.
regexp *re = (curpm) ? curpm->op_pmregexp : NULL;
-----------------------------------------------------
Looks like a syntax error, does anyone have a good copy of Regexp.xs
or an alternative solution?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 10 Aug 2000 12:27:44 GMT
From: Sergey Aleshin <asg@natlib.udm.ru>
Subject: Re: problem perl/cgi Apache web server on win 98 Help!
Message-Id: <8mu740$20a6$3@dfree.natlib.udm.ru>
shebang <lorraine.macfarlin@manchesteronline.co.uk> wrote:
> Hi,
> Can anyone assist in solving a problem I am having running a perl cgi script
> on Apache server for win98.
> All CGI script alias etc. enabled in httpd.conf and server running fine.
> Perl scripts processed at command line no problem.
> But CGI run fails . error message in Logs is can't spawn child process.
First line of your script must be like this:
#!perl
--
Sergey Aleshin
e-mail: asg@natlib.udm.ru
ICQ UIN: #73148842
------------------------------
Date: Thu, 10 Aug 2000 13:03:28 +0200
From: "Kåre Olai Lindbach" <barbr-en@online.no>
Subject: Re: Problem using DBI
Message-Id: <vXvk5.5258$aK5.86987@news1.online.no>
Kåre Olai Lindbach <barbr-en@online.no> skrev i meldingsnyheter:...
>
> Á¶°æÇö <mckyung@hananet.net> skrev i
> meldingsnyheter:SSsh5.3$M94.326@news.hananet.net...
> > Hi...
> >
> > I'm using Windows2000 professional and trying to make a board using
perl
> > and ODBC. i downloaded DBI and DBD-ODBC modules and installed them.
> >
> > after i used a code to test it..
> >
> > test-odbc.pl
> > ==============
> > #!/perl
> >
> > use DBI ;
> > print "Content-type: text/html\n\n" ;
> >
> > end ;
> > =============
> >
> > error message is
> > =============
> > Can't load 'E:/Perl/site/lib/auto/DBI/DBI.dll' for module DBI:
> > load_file:ÁöÁ¤µÈ ¸ðµâÀ» ãÀ» ¼ö ¾ø½À´Ï´Ù at E:/Perl/lib/DynaLoader.pm
line
> > 200.
> > at E:/Perl/site/lib/DBI.pm line 158
> > BEGIN failed--compilation aborted at E:/Perl/site/lib/DBI.pm line 158.
> > Compilation failed in require at E:\Inetpub\cgis\test-odbc.pl line 6.
> > BEGIN failed--compilation aborted at E:\Inetpub\cgis\test-odbc.pl line
6.
> > ============
> > i really need to make this board in hurry...
> >
> > bye.. :-)
> >
> >
>
> How did you install the modules? It *seems like* your installation hasn't
> put *the extra files it needs* in the right catalogs.
> When I install DBI, using PPM, I get a file '.packlist' in the
> 'site\lib\auto\DBI'-catalog telling me that these files are installed:
>
> D:\Perl615\bin\dbiproxy
> D:\Perl615\bin\dbiproxy.bat
> D:\Perl615\bin\dbish
> D:\Perl615\bin\dbish.bat
> D:\Perl615\site\lib\Bundle\DBI.pm
> D:\Perl615\site\lib\DBD\ADO.pm
> D:\Perl615\site\lib\DBD\ExampleP.pm
> D:\Perl615\site\lib\DBD\NullP.pm
> D:\Perl615\site\lib\DBD\Proxy.pm
> D:\Perl615\site\lib\DBD\Sponge.pm
> D:\Perl615\site\lib\DBI.pm
> D:\Perl615\site\lib\DBI\DBD.pm
> D:\Perl615\site\lib\DBI\FAQ.pm
> D:\Perl615\site\lib\DBI\Format.pm
> D:\Perl615\site\lib\DBI\ProxyServer.pm
> D:\Perl615\site\lib\DBI\Shell.pm
> D:\Perl615\site\lib\DBI\W32ODBC.pm
> D:\Perl615\site\lib\Win32\DBIODBC.pm
> D:\Perl615\site\lib\auto\DBI\DBI.bs
> D:\Perl615\site\lib\auto\DBI\DBI.dll
> D:\Perl615\site\lib\auto\DBI\DBI.exp
> D:\Perl615\site\lib\auto\DBI\DBI.lib
> D:\Perl615\site\lib\auto\DBI\DBIXS.h
> D:\Perl615\site\lib\auto\DBI\Driver.xst
> D:\Perl615\site\lib\auto\DBI\dbd_xsh.h
> D:\Perl615\site\lib\auto\DBI\dbi_sql.h
>
> If you unpack your tar.gz-file, using ex. WinZip, you might put them there
> manually. Not all files are required, but it makes a complete
installation.
>
>
> --
>
> Regards/mvh
> Kåre Olai Lindbach
> (LLP - 955626397 MVA)
> + 47 61282501(home/job)
> + 47 95282501(mobil/cellular)
> + 47 61282502(fax)
> barbr-en@online.no
> # HAR KASTET PERL'ER som ikke FOR-SVINner siden ' 94.
>
>
>
>
------------------------------
Date: 10 Aug 2000 04:40:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: reg expressions - protect html
Message-Id: <m1r97xjqd0.fsf@halfdome.holdit.com>
>>>>> "Wyzelli" == Wyzelli <wyzelli@yahoo.com> writes:
Wyzelli> So thats why it sounds so silly when people say "an hotel".
And why we yanks get confused when we hear a brit say "an historic
occasion". Sorry, I pronounce the "h" pretty hard there, so it
sounds more natural for me to say "a *h*istoric occasion".
OK. Sorry. Way off topic. Back to your regularly scheduled
bickering and trolling, frequently punctuated by an actual non-FAQ
question being answered in a useful way...
:-)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 10 Aug 2000 09:46:38 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expressions - protect html
Message-Id: <3992B23E.6269305B@attglobal.net>
"Godzilla!" inhaled some paint thinner fumes and wrote:
>
> Actually what you are displaying is benchmark's inherent
> margin of error which is plus or minus five seconds, as
> an average.
Where did you come up with this little bit of bullshit?
> A good "relative" scientific test would be
> one million iterations, ten sets each, with your results
> averaged. Ten million iterations in ten sets for each
> code snippet, averaged, would be fairly accurate for
> relative comparisons of code snippets, if you establish
> identical conditions and controls, but would be highly
> inaccurate for any stand alone timing of a single
> code snippet.
Well, professor, why don't you step off of your high horse
and run the benchmark in the way you think would prove
your point? Hell, all you have to do is edit the code
to add a few 0's, even you can do that.
> Benchmark has too great a margin of
> error for single code snippet timing. It is only
> good for relative comparsions, with timing results,
> the numbers themselves, being meaningless as a true
> reflection of actual event times.
More lies, more unfounded claims, more fumes.
------------------------------
Date: 10 Aug 2000 07:56:53 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Sort of a sort problem.
Message-Id: <m1g0odjhai.fsf@halfdome.holdit.com>
>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:
>> my @sorted = map substr($_, 4) => sort
>> map { /(\d+)/; sprintf("%04u", $1).$_ } @files;
This is dangerous. What if /(\d+)/ fails? You get the previous $1!
*never* use $1 unless it is in conditional code based on the success
of the match! Or at least, never use it, until you understand why
I say never, then you can use it. :-)
print $1 while "Just another Perl hacker," =~ /(.)/g
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 10 Aug 2000 10:56:12 -0400
From: "Jim_Kearman" <jkearmanNO@mindspring.com>
Subject: Thanks for your help
Message-Id: <8mufqq$3qv$1@nntp9.atl.mindspring.net>
Guess no one here knows much about Perl installation. I'll stick to ASP.
------------------------------
Date: Thu, 10 Aug 2000 14:30:55 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: truncate var spaces
Message-Id: <8mueb0$l5p$1@nnrp1.deja.com>
In article <8mso00$fcd$1@nnrp1.deja.com>,
fg19537@my-deja.com wrote:
> Thank you Logan Shaw for previous answer.
> Related question: I want to use results of one query to perform
another.
> Is there a better perl programming method of truncating the white
spaces
> at the end of a variable (while leaving internal spaces alone) than
what
> I show below? (setting var 3 times)
>
> #!/home/tools/bin/perl -w
> use DBI;
> $dbh = DBI->connect("DBI:Informix:pro");
> $sth = $dbh->prepare(q%select fname, lname
> from names%);
> $sth->execute();
> $ref = $sth->fetchall_arrayref();
> for $row (@$ref) {
> $fname = $$row[0];
> $fname =~ s/^\s+//;
> $fname =~ s/\s+$//;
> print "where fname = '$fname';\n";
> }
> $dbh->disconnect;
> RESULT: where fname = 'billy bob';
> OLD
> RESULT: where fname = 'billy bob ';
Seems to me like this doesn't have to be a Perl question. Does you
RDBMS support RTRIM and/or LTRIM? As in:
select full_name = LTRIM(RTRIM(fname)) + ' ' + LTRIM(RTRIM(lname)) from
names where fname is not null and lname is not null
Then just in case there are multiple spaces in the middle of a feild
(like the crap data we had to import in our main database), you can turn
that into a Perl question, like you had before:
$full_name =~ s/\s+$//;
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 10 Aug 2000 09:45:43 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Using True Type Fonts with GD module?
Message-Id: <3992B207.4E8F7761@hotmail.com>
Hi,
I need to place a TTF text over a JPEG image. I know that GD is supposed
to be able to do that. I read the FAQ and I found that I have to compile
libgd to include stringTTF() call for TrueType support.
Has anyone been able to do that? What is the sequence of steps I have to
go through?
I would appriciate any help!
Thanks!
Alex
------------------------------
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 3975
**************************************