[16292] in Perl-Users-Digest
Perl-Users Digest, Issue: 3704 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 18 06:05:28 2000
Date: Tue, 18 Jul 2000 03:05:14 -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: <963914714-v9-i3704@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 18 Jul 2000 Volume: 9 Number: 3704
Today's topics:
Re: [NEWBI] Reg Exp request for help <bart.lateur@skynet.be>
chop vs. chomp (was: Read a file into a hash ?) <iltzu@sci.invalid>
Re: convert file permissions; octal-->stat <gellyfish@gellyfish.com>
Re: cpan patch to use wget <gellyfish@gellyfish.com>
Re: Difference between a .cgi file and a .pl file? (Villy Kruse)
Re: flock nonsense ? <ingenuous@mail.ru>
Re: GD module, displaying an image in a browser <stephane@siw.ch>
Re: How can i identify a "Not Integer" string ? <bart.lateur@skynet.be>
Re: how to convert "1.2.3.10" to "01020310"? (Abigail)
Re: How to get the machine (archtechture) type in Perl? <mariusz.lukasiewicz@lido-tech.net>
Re: Https URL checking LWP simple <gellyfish@gellyfish.com>
Re: I need some advice <mariusz.lukasiewicz@lido-tech.net>
Re: I need some advice <bart.lateur@skynet.be>
Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible? <bill.kemp@wire2.com>
Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible? <andreas@waikato.ac.nz>
Re: Need advice on converting excel files. mcnam@my-deja.com
Re: NEW: AI::NeuralNetwork - idea, comments <callgirl@la.znet.com>
Re: Perl and Mysql <thunderbear@bigfoot.com>
Re: Perl can't add ! (Csaba Raduly)
Re: Posting bug reports = mail spam?? <gellyfish@gellyfish.com>
Re: searching for a # within a range <cg@schlund.de>
Re: sound editing <sb@muccpu1.muc.sdm.de>
storing record <lihock@pc.jaring.my>
Re: String and Hash question...rather urgent <cal@iamcal.com>
Re: Suggestion for syntax change <bart.lateur@skynet.be>
Re: Testing and debuging scripts locally <gellyfish@gellyfish.com>
Re: Viewing HTTP headers <guymal@hotmail.com>
Re: write to 2 dbm files simultaneously? <milosk@flashcom.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 18 Jul 2000 11:54:37 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: [NEWBI] Reg Exp request for help
Message-Id: <mg88ns07oekorvf2am8c7hnjefqcphegl5@4ax.com>
Joe Kline wrote:
>Give the following a whirl:
>
>$line =~ s/(\w)(\w+)?/\u$1\L$2\E/g;
You betters rewrite
(\w+)?
as
(\w*)
Why? because if you try to match a word consisting of one letter, $2
would be undefined, and you'd get a "use of undefined value" warning.
But, as someone else already said, Perl is smart enough to understand
"\u\L$1" and "\L\u$1";
And finally, note that there are some exceptions on this name
capitalization scheme, as with "McSomething".
--
Bart.
------------------------------
Date: 18 Jul 2000 07:58:18 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: chop vs. chomp (was: Read a file into a hash ?)
Message-Id: <963906425.28118@itz.pp.sci.fi>
In article <k8ektozh.fsf@macforce.sumus.dk>, Jakob Schmidt wrote:
>Certainly. But I think I remember that chop is faster (as it would seem
>obvious) so it may still be defended in a cas such as this where the input is
>very disciplined. You may argue of course that the solutions posted in this
>forum serve as general examples as well and ought to be fool proof.
We could indeed argue that - and in fact we frequently do.
We could also argue that any speed difference is totally insignificant
unless the operation is done in a tight loop, and probably even then.
Further, we could argue than any claims about execution speed are next
to worthless unless backed by benchmarks, and that benchmark results
can sometimes be quite surprising:
#!/usr/bin/perl -w
use strict;
use Benchmark;
timethese 1<<(shift||0),
{ chop => '$_ = "\n"x1024; chop while $_;',
chomp => '$_ = "\n"x1024; chomp while $_;',
};
__END__
Benchmark: timing 65536 iterations of chomp, chop...
chomp: 44 wallclock secs (43.74 usr + 0.00 sys = 43.74 CPU)
chop: 51 wallclock secs (50.52 usr + 0.00 sys = 50.52 CPU)
This is perl, version 5.005_03 built for i386-linux
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: 18 Jul 2000 09:24:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: convert file permissions; octal-->stat
Message-Id: <8l147h$jdt$1@orpheus.gellyfish.com>
[ Removed the long defunct comp.lang.perl ]
In comp.lang.perl.misc ogiven@vertex.ucls.uchicago.edu wrote:
> I'm grabbing the permission info on a remote file via Net::FTP's dir
> command.......then parsing the -rwxrwxrwx entry into octal form. BUT i
> then need to convert the octal num into the kind of num that stat
> returns when it gives you a file mode, so that i can chmod the local
> file from within my Perl script.
>
> i know a bit shift sequence to convert file perms from the stat format
> to octal (@modelist = (($mode&0700)>>6, ($mode&0070), ($mode&0007));),
> but i don't know how to do the opposite: convert a file perm from octal
> to the stat representation.........
>
> can anyone suggest a way?
> OR, since my knowledge of "bits" and such is sorely lacking, can anyone
> point me to some documentation on the subject. i've done a lot of
> search engine/usenet querying, but i'm not turning up anything
> relevant....
>
I misread your question the first time round as you having problems parsing
the output of ls -l into octal so I hacked together this brute force
method :
#!/usr/bin/perl -w
use strict;
my @files = map { chomp; [ unpack 'A11A4A9A9A9A13A*',$_ ]; } `ls -l`;
foreach (@files)
{
my ( $mode, $file) = @{$_}[0,6];
my $octmode = '0';
foreach my $ugo ( $mode =~ /^.(.{3})(.{3})(.{3})/ )
{
my $thismode = 0;
$ugo =~ /r/ && ($thismode += 4);
$ugo =~ /w/ && ($thismode += 2);
$ugo =~ /x/ && ($thismode += 1);
$octmode .= $thismode;
}
print "$file $mode", oct $octmode,"\n";
}
It doesnt deal with setuid or setgid file though. I think the answer to
your question is simply 'oct' though ...
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 18 Jul 2000 10:06:50 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cpan patch to use wget
Message-Id: <8l16na$jhd$1@orpheus.gellyfish.com>
On Mon, 17 Jul 2000 04:36:25 GMT Michael Dean wrote:
>
> Hellow there
>
> I'm not sure of the procedure for getting changes put into CPAN,
> but I'm always patching CPAN to use wget, so here are the changes
> I make ... have fun cut'n'pasting, remember to set .
>
The CPAN module is maintained by Perl5-Porters - you could submit the
patch there directly, via perlbug or to the author as listed in the
manpage. Anyhow cheers for that - I had been thinking about that a
little while ago.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: 18 Jul 2000 08:43:09 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <slrn8n84sn.en0.vek@pharmnl.ohout.pharmapartners.nl>
On 17 Jul 2000 10:16:23 EDT, Abigail <abigail@delanet.com> wrote:
>DS (snakeman@kc.rr.com) wrote on MMDXI September MCMXCIII in
><URL:news:vjmc5.94$L5.2310@typhoon.kc.rr.com>:
>][ What is the diference betweeen a .pl file and a .cgi file?
>
>The name.
>
>][ Can I convert a .pl to a .cgi?
>
>Sure. Rename the file.
>
>
>
Correct.
In some systems the extensions are magic, so a perl script is recognized
as such only based on the suffix.
On unix systems in general the suffix on executables is not used for any
purpuse; the '#!' line does that. And if you install CGI programs in
a dedicated cig-bin directory, the web server doesn't care either.
Villy
------------------------------
Date: Tue, 18 Jul 2000 10:18:14 +0300
From: "Oleg Goryunov" <ingenuous@mail.ru>
Subject: Re: flock nonsense ?
Message-Id: <963905262.763154@ipt2.iptelecom.net.ua>
> >Why should I agonize with flock?
> >
Jonathan Stowe:
> I really dont get this, what precisely is wrong with the
>documentation that people have such difficulty with it ?
>
It is rather interesting matter on locking a file over NFS.
The only right decision could be to publish a fragment of a Perl
program that indeed locks the file being OS independent. Instead
we see theoretical reasonings (or go to recommendations) without
any practical results (if they are, they are declared as wrong
ones). May be it's impossible at all - to lock a file over NFS
correctly? Is the locking a myth?
Indeed the perldoc is the first ring in the chain.
Oleg
------------------------------
Date: Tue, 18 Jul 2000 07:18:17 GMT
From: "Chello" <stephane@siw.ch>
Subject: Re: GD module, displaying an image in a browser
Message-Id: <ZwTc5.64102$7D2.990513@news.chello.at>
In fact I tried in my PerlBuilder but normally it display images.....
"Joseph Pepin" <pepin@worldnet.att.net> wrote in message
news:kW7c5.10095$tI4.796028@bgtnsc05-news.ops.worldnet.att.net...
> Chello, Krakle is incorrect here. The latest & greatest GD supports JPEG,
> PNG, and several others. It can read more formats than it can write. It
also
> supports TrueType fonts. I don't know what's wrong with your code, but
> you've got the GD part correct. What does your HTML look like?
>
> > > What's the problem and how to solve it??? Does
> > someone have the solution??
> > >
> > > Thanks in advance.
> > >
> > > Stéphane
> > >
> > >
> >
> >
> > ---GD is a graphics library that generates images
> > in the GIF format not jpeg format...
> >
> > Change print "Content-type:image/jpeg\n\n";
> > to
> > print "Content-type:image/gif\n\n";
> >
> > Also the new version of GD generates PNG...
> >
> > GD is minimal i reccomend using GIMP on a unix
> > maching... Or atleast GD&TTF (freetype AND gd)
> > from the-labs.com
> >
> > ---krakle
> >
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>
------------------------------
Date: Tue, 18 Jul 2000 11:54:45 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How can i identify a "Not Integer" string ?
Message-Id: <0o98ns0fakkvdf5gf8uc03mte72u9e4mg5@4ax.com>
Election wrote:
>I've got a string that stores the result like this
>
>$string = int($n1 / $n2);
>
>but it always gives me an integer number , so what should i do ?
Try the modulo operator.
if($n1 % $n2) {
print "$n1 notdivisible by $n2!\n";
}
--
Bart.
------------------------------
Date: 18 Jul 2000 04:08:56 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <slrn8n855s.v90.abigail@alexandra.delanet.com>
Craig Berry (cberry@cinenet.net) wrote on MMDXIII September MCMXCIII in
<URL:news:sn7t63sno53115@corp.supernews.com>:
-- Abigail (abigail@delanet.com) wrote:
-- : [] Nope. This is reasoned. map must accumulate results and build a list
-- : [] only to throw it away; for does not carry this overhead. As the two hav
-- : [] roughly equal notational convenience, it makes sense to use the more
-- : [] efficient choice.
-- :
-- : map, of course, doesn't have to. Every other function in Perl is able
-- : to figure out its context, and act accordingly. I've never heard any
-- : convincing argument (in fact, I've never heard any argument) why map
-- : has to build a list regarding of its context. The fact that map does is
-- : a bug in perl. In perl that is, not in Perl. There's no reason to avoid
-- : map in Perl. There is a reason to fix the implementation of map in perl
-- : though. However, it has been known for a long, long time, but hasn't been
-- : found important enough to fix.
--
-- Of course. And more important, the efficiency argument is far less
-- central than the documentation-of-intent argument. foreach communicates
-- an intention to operate purely for side effects; map communicates an
-- intention to operate functionally. Speaking as someone who has had to
-- maintain a *lot* of old code (my own included), I state with some force:
-- The more you can do through coding conventions (applied fairly uniformly,
-- if informally) to make your code easy to eyeball-parse, the easier your
-- job will be when you're trying to brush aside the cobwebs a year from now.
Where is this "intent" defined? Or is this arbirary, just as using
tr/// to remove letters, and y/// to remove digits?
I find these "intent" arguments not very convincing, but if you really
want Python, you know where to get it.
But, for me, the intent of map is to mainly apply a function to each
element of a list. Whether that function has a side effect or not is
irrelevant. map {printf "%02d" => $_} @array couldn't be clearer.
-- : I don't see a reason to change my programming habits for your strange
-- : parser. If you see a print, do you think "where will the resulting
-- : value go"? As for strings, I am really baffled. Why on earth would you
-- : backtrack? How do you read single quoted strings? If you read English,
-- : do you do that letter by letter as well? I guess that use of qq or q
-- : gives you a nervous break down. All those different delimiters! I hope
-- : noone will ever tell you about autoquoted barewords. You'd experience
-- : a brainmelt!
--
-- Reductio ad absurdem won't get you far.
Reduction ad absurdem is an important, and often beautiful, technique
when proving theorems. I wouldn't want to leave home without it.
-- I'm not saying I can't read any
-- arbitrary odd use of Perl syntax, nor that I apply a uniform and
-- mechanical rule requiring e.g. checking of print's return value. I *am*
-- saying that I take the easy "eyeball parser optimizations" -- things like
-- choosing quote syntax and map vs. foreach based on intended use -- as
-- consistently as I can managed. Even if I save only a tenth of a second of
-- brain processing per line of code read, that still adds up to a long lunch
-- on Friday. :)
--
-- : [] A lot of this stuff falls into the same more general category as e.g.
-- : [] indenting your code, or including comments. Perl doesn't care, but *you*
-- : [] will, or the maintenance programmer who comes after you.
-- :
-- : If a programmer gets confused if there's no interpolation happening in
-- : a double quoted string, then than programmer should not program.
--
-- I think perhaps you're picturing me coming to a screeching halt, jaw
-- hanging slack as I stare dumbfounded at the interplation-free dquoted
-- string.
That's how you describe yourself, yes. And complaining a FOUR character
string which was double quoted only confirms that impression.
-- It's more like a flash of mental setup followed instants later by
-- a flash of self-correction. I see e.g.
--
-- $foo = "Here's a very &//? long and sym&^bol-\$rich string blah blah!";
--
-- deep inside the program somewhere. I can't grok that string all at once,
-- so I prepare to scan it for stuff of interest. Being double-quoted, I'm
-- looking for the whole family of escapes, plus interpolations. At the same
-- time, I'm forming hypotheses about what $foo might be used for just below,
Really? I'd say that if you need to analyze the content of a string to see
what it is being used for, something is wrong. Context, variable name, or
even comment should make it clear.
I also find it utterly amazing that while someone can't grasp the
string
"Here's a very &//? long and sym&^bol-\$rich string blah blah!",
all at once, he apparently *can* grasp
'Here\'s a very &//? long and sym&^bol-$rich string blah blah!'
all at once. After all, if one can't, it would not matter what quotes are
used, would it?
Me, I would look at the first string, see there's no interpolation
going on, so I wouldn't care at all what the quotes are. As for the
single quotes form, I'd probably think "hmmm, $rich isn't a variable,
oh, that's ok, it's single quoted anyway".
-- what variables might be important that were mentioned right above, and how
-- they might help build $foo. Then I actually scan the string, find it
-- could have been single-quoted, and change my model to fit the '$foo starts
-- off as a statically-defined string' reality. All of this goes on in an
-- instant, without conscious effort, since I've been doing this for a while.
-- But it *does* take a tiny bit more work and time than would be the case if
-- the string were single-quoted. And tiny bits add up.
You picked an interesting example as "counter argument", as the funny
string contains a single quote.
-- : BTW, don't tell me you ever do s/^\s+//;, you should of course be doing
-- : s'^\s+'';. You wouldn't want to confuse the maintenance programmer, having
-- : to backtrack a 4 character string for missing interpolation!
--
-- Again, reductio ad absurdem. Oh, and I reserve the right to pick and
-- choose, too. :)
Tell me, which of your arguments you use to promote single quotes when no
interpolation takes place, while reserving double quotes only when there's
interpolation, doesn't apply to s///?
Abigail
--
perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'
------------------------------
Date: Tue, 18 Jul 2000 08:07:05 GMT
From: Mariusz =?iso-8859-1?Q?=A3?= <mariusz.lukasiewicz@lido-tech.net>
Subject: Re: How to get the machine (archtechture) type in Perl?
Message-Id: <3974278D.6EE9ED92@lido-tech.net>
--------------D38648BB314756FB6CD1FF41
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
perldoc Config
see example there ;-)
"J. H. Park" wrote:
> **** Post for FREE via your newsreader at post.usenet.com ****
>
> Hi
>
> I want to tell if the machine I am in
> is a LINUX or SGI IRIX.
>
> Is there an easy way to do so in Perl?
> Or is there Shell variable already
> defined?
>
> Thanks,
>
> Jong
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
> http://www.usenet.com
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
--
Rgds
Mariusz.
----------------------------------------------------------------
Mariusz £ukasiewicz Lido Mail: lukmar1@mail.lido-tech tel. ext 30
Lido Technology E-mail : mariusz.lukasiewicz@lido-tech.net
--------------D38648BB314756FB6CD1FF41
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<br>perldoc Config
<p>see example there ;-)
<br>
<p>"J. H. Park" wrote:
<blockquote TYPE=CITE>**** Post for FREE via your newsreader at post.usenet.com
****
<p>Hi
<p>I want to tell if the machine I am in
<br>is a LINUX or SGI IRIX.
<p>Is there an easy way to do so in Perl?
<br>Or is there Shell variable already
<br>defined?
<p>Thanks,
<p>Jong
<p>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
<br> *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet!
***
<br>
<a href="http://www.usenet.com">http://www.usenet.com</a>
<br>-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</blockquote>
<pre>--
Rgds
Mariusz.
----------------------------------------------------------------
Mariusz £ukasiewicz Lido Mail: lukmar1@mail.lido-tech tel. ext 30
Lido Technology E-mail : mariusz.lukasiewicz@lido-tech.net</pre>
</html>
--------------D38648BB314756FB6CD1FF41--
------------------------------
Date: 18 Jul 2000 09:27:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Https URL checking LWP simple
Message-Id: <8l14dq$jea$1@orpheus.gellyfish.com>
On Mon, 17 Jul 2000 16:46:17 GMT lucap@my-deja.com wrote:
>
>
> i'm using LWP:simple for a quick url check:
>
> if (head($url)) {
>
> ...
> }
>
> I just found that this does not accept https addresses,
>
> any workarounds ?
>
You will need to install Net::SSL and use LWP::UserAgent ....
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 18 Jul 2000 08:23:52 GMT
From: Mariusz =?iso-8859-1?Q?=A3?= <mariusz.lukasiewicz@lido-tech.net>
Subject: Re: I need some advice
Message-Id: <39742B77.53F9301A@lido-tech.net>
--------------68422892DCAB8BC1DC0E2718
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Hi
If you want to distinct HTML from pure perl code try to use perl formats
It's simple mechanism for creating reports.
Type:
perldoc perlform
--
Rgds
Mariusz.
----------------------------------------------------------------
Mariusz £ukasiewicz Lido Mail: lukmar1@mail.lido-tech tel. ext 30
Lido Technology E-mail : mariusz.lukasiewicz@lido-tech.net
--------------68422892DCAB8BC1DC0E2718
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi
<p>If you want to distinct HTML from pure perl code try to use perl formats
<br>It's simple mechanism for creating reports.
<br>Type:
<br>perldoc perlform
<br>
<br>
<br>
<pre>--
Rgds
Mariusz.
----------------------------------------------------------------
Mariusz £ukasiewicz Lido Mail: lukmar1@mail.lido-tech tel. ext 30
Lido Technology E-mail : mariusz.lukasiewicz@lido-tech.net</pre>
</html>
--------------68422892DCAB8BC1DC0E2718--
------------------------------
Date: Tue, 18 Jul 2000 11:54:40 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: I need some advice
Message-Id: <an88nsc4729bbg80asdrr3does1r7kotdv@4ax.com>
Filipe de Matos wrote:
>Now i´m looking for some way to separate the perl code from the HTML
>as much as possible.
>I´ve been reading about "HTML::Template", "embPerl", "ePerl", etc...
>but i don´t have any experience with any of them.
If you want to *separate* the Perl code from the HTML, then embPerl,
ePerl, HTML::Mason, and further down the road: ASP, PHP, Cold Fusion, ae
the wrong way.
You want a template mechanism. I use my own breed, but in approach it's
very similar to HTML::Template. That would be my first choice for
looking into; unless you want to build your own.
>Something that isn´t
>obvious to me is if i still can write my code with "normal" perl
>tags or if i only can use a set of module specific language elements.
>Still i can call other modules like Postgres.PL to access my database
>from inside of this scripts (or even from inside embedded perl)?
Er... you're doing it again. You're mixing execution code and layout.
The template philosophy (if that ain't too big a word) wants you do do
all your coding, including preparing data, in a script, and do your
layout in a template. For incorporating database query results, first
you fill some Perl data structures with the data you get back from the
database, and use this to interpolate into your template. At least,
HTML::Template does provide a way for looping, i.e. repeating a certain
text fragment, with different variable values.
OTOH, I've not even tried out HTML::Template. I've only read about it.
--
Bart.
------------------------------
Date: Tue, 18 Jul 2000 09:08:22 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible??
Message-Id: <963907849.14098.0.nnrp-02.c3ad6973@news.demon.co.uk>
<snip>
> The question is: is it possible to share both PHP, mod_perl and
>mod_ssl built on an Apache server? Or is it just plain stupid compiling
>mod_perl when you have PHP?
Not stupid, but you might look at how its using memory.
You might look at having different Apache server types on one machine.
One plain, one mod_perl one PHP perhaps?
(Would this be a neopolitan set-up? One vanilla, one strawberry and one
chocolate.)
(PS Neopolitan is a type of ice-cream in case this is not a global concept)
------------------------------
Date: Tue, 18 Jul 2000 22:01:23 +1200
From: "Andreas" <andreas@waikato.ac.nz>
Subject: Re: MySQL+Apache+PHP+mod_perl+mod_ssl - Is it possible??
Message-Id: <963914431.535208@ham.ihug.co.nz>
I have got a short HOW-TO on the web when I did it a while ago. You can
find it at http://kiwi.nu/apache-compile.htm
Andreas
------------------------------
Date: Tue, 18 Jul 2000 07:50:24 GMT
From: mcnam@my-deja.com
Subject: Re: Need advice on converting excel files.
Message-Id: <8l127s$807$1@nnrp1.deja.com>
In article <v3Lb5.15$cK2.780@sjc-read>,
Kirill Sapelkin <znanie@shell5.ba.best.com> wrote:
> The problem is that xlsHtml fails sometimes on large xls files with a
> lot of text. Just the sort of thing that I am dealing with.
>
> Can perl help in this regard? Do I have to upgrade to 5.6? I have
found a
> package called ole storage.
Do you mean xlHtml from http://www.xlhtml.org/ ? If so this is your best
bet on UNIX. It is derived from OLE::Storage but is much more robust.
On Windows you can also use Win32::OLE.
See
http://www.activestate.com/ActivePerl/docs/faq/Windows/ActivePerl-Winfaq
12.html and
http://www.activestate.com/ActivePerl/docs/site/lib/Win32/OLE.html
John McNamara
--
Try before you die()
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 18 Jul 2000 01:50:16 -0700
From: Kiralynne Schilitubi <callgirl@la.znet.com>
Subject: Re: NEW: AI::NeuralNetwork - idea, comments
Message-Id: <39741A48.C0A9E4FC@la.znet.com>
Josiah Bryan wrote:
> I have finished a new module designed to simulate simple
> neural networks completly with Perl. I am writing to
> .modules mainly to see if anyone has any objections to
> the namespace, or suggestions for a better namespace.
> Synopsis:
> use AI;
(snipped)
I will register an objection to use of "AI" within
your module name. This suggests your module employs
"Artificial Intelligence" which is, with current
technology, regardless of programming language,
quite impossible even at a primitive level.
We are centuries away from any programming
which can be labeled, Artificial Intelligence,
with any degree of accuracy and truth.
Use of AI with your module name could possibly
lead to ridicule of Perl in general by numerous
leaders in Artificial Intelligence. These leaders
are well qualified, have been involved in this
area of research for decades and, will quickly
point out, "Some yoyo over in Perl thinks he
has created Artificial Intelligence."
My credentials are well known by you and many
others as being the first and, to the best of
my knowledge, only _Perl_ programmer to develop
comprehensive and complex androids which mimic
Artificial Intelligence, but by no means represent
our true notion of Artificial Intelligence. My
androids are smart, they learn, but require
extensive intervention and assistance by my
hand to perform and pull off what amounts to
very talented smoke and mirrors tricks. Others
have enjoyed some success in Perl "pseudo-AI"
but few have invested years in this project
as I have. It is my field of expertise in
our Perl language and, I will quickly and
decisively point out, my androids are Sagan's
"billions and billions" of light years in
distance from true Artificial Intelligence.
To be sure there is no misunderstanding, I will
credit my success in pseudo-AI to Simon Laven,
Joseph Weizembaum, Richard Waugh, Dr. Werner
Wilhelm Webowitz and many others, whose hard
work laid a foundation for what I have done.
Without these people, my androids would not
exist. I owe these people and respect these
people breaking ground in AI techniques.
Personally, I would be significantly embarrassed
to have true professionals in this area of AI,
people who have dedicated their educations and
careers to AI research, I would be embarrassed
to have them surmise, Perl programmers think
themselves to be one-up on AI development. My
respect goes to these AI professionals and,
I do object to anything, Perl related, which
they may find insulting or a point of ridicule.
Our Perl Community is experiencing sufficient
difficulties as it is with its community image.
Adding to these image difficulties is remiss.
This listing represents a very small percentage
of leaders in AI research and development. This
listing will also clue you in on why it would
embarrass me to have even one of these people
think our Perl Community has a handle on AI.
Read and learn, develop some respect for these
true dedicated professionals, then consider
a name for your module more appropriate for
what you are attempting to create,
"Programmable Associative Arrays"
http://www.cs.berkeley.edu/~russell/ai.html#logic
Referring to AI lightly, humorously or in
jest, as I often do, is quite acceptable.
However, using this term "AI" in an official
capacity, using this for a module, in my
personal opinion, is disrepectful and
most inappropriate. This is quite biting
with your claims of mastering two very
basic concepts in AI which have boogered
the minds of the best seemingly forever;
Hebb's Rule and the Delta Rule.
Incidently, terminology is Hebb's Rule or
Hebbian Learning, rather than Hobb's rule
as you have incorrectly cited within your
illuminati article.
I am interested to learn how you overcame
weight vectoring and gradient descents
based on paraboloid surfaces, this is,
how you reduced such multi-vectored
analog complexity to simple zero or one.
I anticipate release of your module and,
be sure I will exhaustively test this
module's alleged ability to learn via
neural networking.
My expectations are you will release this
module within, hmm.. a week? You have
indicated it is finished, yes?
Regards,
Kiralynne Schilitubi, aka Godzilla!
--
$godzilla = "godzilla rocks!";
srand(time() ^ ($$ + ($$ << 15)));
sub randcase
{ rand(40) < 20 ? "\u$1" : "\l$1" ; }
$godzilla =~ s/([a-z])/randcase($1)/gie;
print $godzilla; exit;
------------------------------
Date: Tue, 18 Jul 2000 11:29:27 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Perl and Mysql
Message-Id: <39742377.5D198497@bigfoot.com>
David Fleet wrote:
> What can I do??
Use DBI and ask DBI to report errors and die with
$dbh = DBI->connect($dsn, $user, $password,
{ RaiseError => 1, AutoCommit => 0
});
I would suspect your $dsn to be incorrect.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: 18 Jul 2000 09:42:22 GMT
From: csaba_r@my-deja.com (Csaba Raduly)
Subject: Re: Perl can't add !
Message-Id: <8F7560A1Equuxi@194.203.134.200>
18 Jul 2000: A formal bug report was sent to Seti@Home, because the
following message originated from abigail@delanet.com (Abigail) was
reported as containing signs of intelligence:
>Abigail
>--
>$; # A lone dollar?
>=$"; # Pod?
>$; # The return of the lone dollar?
>{Just=>another=>Perl=>Hacker=>} # Bare block?
>=$/; # More pod?
>print%; # No right operand for %?
>
Ugh.
fraction:~ $ perl -MO=Deparse abigail.pl
abigail.pl syntax OK
$; = $";
$;{join $;, 'Just', 'another', 'Perl', 'Hacker'} = $/;
print %;;
Ha ! I can (barely) understand it (thanks to perldoc perlvar).
But a six line sig ? Are you losing your touch :-))))))
--
Csaba Raduly, Software Developer (OS/2), Sophos Anti-Virus
mailto:csaba.raduly@sophos.com http://www.sophos.com/
US Support +1 888 SOPHOS 9 UK Support +44 1235 559933
Life is complex, with real and imaginary parts.
------------------------------
Date: 18 Jul 2000 09:58:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Posting bug reports = mail spam??
Message-Id: <8l167l$jg4$1@orpheus.gellyfish.com>
On Mon, 17 Jul 2000 08:44:29 GMT Richard Lawrence wrote:
>
> After submitting a bug report to perl5-porters my work email address
> was inundated with spam. After some searching I've come to the
> conclusion that someone has been harvesting the email addresses of all
> posts to the perl5-porters newsgroup.
>
<snip>
>
> Before I start complaining to the perl5-porters, I'd like to know if
> anyone else has had similar experiences? Or am I in the minority here?
>
I dont think that complaining to p5p is really appropriate, after all it
is not they who do the spamming and not harvesting the addresses either.
Complain to the ISP from whence the spam originated or their upstream
provider. I guess it might be possible for the maintainers of the p5p
archive could devise a mechanism to prevent address harvesting, but they
might be more inclined to do so if assistance to do so were offered to them.
Quite honestly I know I do get spam but even relatively simple filters
prevent me from actually seeing the vast majority of it. I wouldnt
care to take a guess from where my address has been harvested though
- and I have sent bug-reports to p5p.
Your address could be harvested from anywhere just the same - it is an
unfortunate fact of internet life that there are these scumbags ( they
would describe themselves as legitimate business people) out there doing
this stuff. You might want to look at MJDs articles on spam-filtering on
<http://www.perl.com>.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 18 Jul 2000 10:58:22 +0200
From: Carsten Gaebler <cg@schlund.de>
Subject: Re: searching for a # within a range
Message-Id: <39741C2E.FADCE398@schlund.de>
What kind of database are you using? If there is an SQL interface,
just tell it to SELECT something FROM sometable WHERE price >
150000 AND price < 200000
padme67@my-deja.com wrote:
>
> I am new to Perl, cgi and coding...
> That said I am trying to do a search on a database that will determine
> if any value in the database falls into a user defined range.
> 1)I have a drop-down menu that a user can choose a price range(i.e.
> $150,000-200,000 etc.)
> 2)When submitted my program looks through the db to find any values
> that fall into the range chosen.
>
> I can pattern match with words or phrases but finding a # in a range
> has me stumped. If someone could just push me in the right direction I
> would be eternally grateful!
Carsten.
------------------------------
Date: 18 Jul 2000 08:06:28 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: sound editing
Message-Id: <8l1364$hod$1@solti3.sdm.de>
In article <lsNb5.229$y5.29734@news.shore.net>, aaronp@removeme-shore.net wrote:
> Thank you for the suggestions. Audio::DSP is close. We can easily record
> and playback with it. Now I need to just find a program somewhere which
> will take a sound file ana analyze it for signal strength or FFT. Thanks
> again for the help.
You should have a look at "PDL" on CPAN. It has been written by physicists
(mainly astronomers, from what I know) for fast manipulation of huge amounts
of data (it's written in C, internally). Maybe it includes FFT (I should think
so!).
For manipulating data streams at the bit, byte, machine word or any other
chunk size level, you might want to check out the Bit::Vector module,
which also allows you to perform fast "big integer" arithmetic.
(This module is also written in C, internally.)
Good luck!
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Tue, 18 Jul 2000 16:05:34 +0800
From: "han" <lihock@pc.jaring.my>
Subject: storing record
Message-Id: <8l134t$8i1$1@news6.jaring.my>
Is it possible that perl can do just like cobol storing the db on the index
file only?
------------------------------
Date: Tue, 18 Jul 2000 08:38:14 +0100
From: "Cal Henderson" <cal@iamcal.com>
Subject: Re: String and Hash question...rather urgent
Message-Id: <nPTc5.109$uY6.2185@news6-win.server.ntlworld.com>
"Vinod K. Menon" <anuragmenon@my-deja.com> wrote...
[snip]
:do I have to use individual assignment statements
:
: like $hash1("a") = "1.0 2.0 3.0";
:
: and so on for all keys?
[snip]
$hash1{"a"} = "1.0 2.0 3.0";
would be more sucessfull
--
Cal Henderson
sub a{my$a=reverse shift;$a=~y/b-z/a-y/;unshift@a,$a;}sub b{$c.=reverse
shift; while(length($c)>=$b[0]){a(substr($c,0,$b[0]));$c=substr($c,$b[0]);
shift@b;}}@b=(6,3,5,4,10,6,4,4,2,1);$a="l?jouipv"."ezvmxpbuxih";$a.=
",jofoqqibmzamsfsfxfjtuiIg";while($a ne ""){b(substr($a,0,2));$a=
substr($a,2);}print join(" ",@a);
------------------------------
Date: Tue, 18 Jul 2000 11:54:43 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Suggestion for syntax change
Message-Id: <me98ns4kpbjfkq6mkpd8vh73d3u2msd7uj@4ax.com>
Jakob Schmidt wrote:
>I just asked if this specific example wouldn't
>be ugly.
>
>Well, wouldn't it?
I would like it. This same problem has bitten me in the past. The
discussion may even still be available on Deja.
--
Bart.
------------------------------
Date: 18 Jul 2000 10:15:40 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Testing and debuging scripts locally
Message-Id: <8l177s$ji2$1@orpheus.gellyfish.com>
On Mon, 17 Jul 2000 01:01:32 +0100 EM wrote:
> Is there any way to test if a perl script works without having to go online
> and upload it to my cgi-bin
> Like it would be great if i could somehow start my browser and enter the
> file as c:\scripts\script.cgi and be able to see it as if it were online
>
I'm not sure what your problem is - with Perl installed you can run the
program at the command line on your machine. If your problem is with
the CGI or some web server you should ask in the appropriate group in the
comp.infosystems.www. hierarchy.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Tue, 18 Jul 2000 07:31:10 +0200
From: "Guy" <guymal@hotmail.com>
Subject: Re: Viewing HTTP headers
Message-Id: <8l0mhi$khl$1@news.netvision.net.il>
I don't want to see what http headers the server returns ( I know how to do
that). I want to see what http headers the web server RECEIVES from the html
form that is submitted to it.
Thanks,
Guy
Nivel33 <nivel33@hotmail.com> wrote in message
news:8kvi75$6ps$1@diana.bcn.ttd.net...
> i think that a solution is a telnet conexion to port 80 (Net:Telnet) and
> you`'ll receive the HTTP Headers
>
> send :
> >telnet www.perl.com:80
> >GET /index.html HTTP/1.0
> >
>
>
> receive :
>
> HTTP/1.1 403 Forbidden
> Date: Mon, 17 Jul 2000 18:03:52 GMT
> Server: Apache/1.3.9 (Unix)
> Connection: close
> Content-Type: text/html
>
> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
> ...
>
------------------------------
Date: Tue, 18 Jul 2000 00:23:51 -0700
From: lounge lizard <milosk@flashcom.net>
Subject: Re: write to 2 dbm files simultaneously?
Message-Id: <39740607.4FCE8D91@flashcom.net>
Thanks for the info Bob - I"ve found the problem occurs when just one dbm file
is open also - running it from the command line it says no write permission to
the ndbm file - but I just created it on the same server with another program,
hours ago - how do I creat the file as gdbm or change it to gdbm?
Sorry if this is a stupid q - I'm somewhat new to Perl - thanks
Bob Walton wrote:
> lounge lizard wrote:
> >
> > Can I write to 2 open dbm files at the same time or do I have to close
> > one first - relevant code is:
> >
> > dbmopen (%DATA, $keyIDfile, 0666) || die "can't open file\n";
> > dbmopen (%MAIN, $keyMainfile, 0666) || die "can't open file\n";
> > $DATA{$i} = $member_array[3];
> > $MAIN{$member_array[3]} = $newline;
> > dbmclose (%MAIN);
> > dbmclose (%DATA);
> >
> > I'm getting that I have no write permissoin for MAIN - DATA was created
> > by this program MAIN by another of my programs that I have had no
> > trouble writing to before - anyone help? Thanks
>
> You should have no trouble writing to two or more DBM-type files
> simultaneously as long as you are not using either DBM or NDBM (I am
> running a program with 11 simultaneous dbmopen's open for write as I
> type this). You need to be sure your system supports whatever DBM-type
> (like DBM, NDBM, GDMB, SDMB, DB_File, etc) your dbmopen uses. Note that
> if you use Windoze with a FAT or FAT32 file system, SDBM won't work (it
> will seem like it does, but it will drop a significant fraction of the
> keys as the file size gets larger than trivial). Note that SDBM was the
> default type used by most Windoze versions of Perl prior to Perl version
> 5.6 (it looks like the default is now DB_File, which will work with
> FAT/FAT32 filesystems). Question: was the "main" data file written
> using the same DBM-type? If it was on another computer, maybe it
> wasn't. Also, there may be a possibility the implementation of a given
> DBM-type may differ between different operating systems, so it may be
> that a file written on one system might not be usable on a different
> system.
> --
> Bob Walton
------------------------------
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 3704
**************************************