[11511] in Perl-Users-Digest
Perl-Users Digest, Issue: 5111 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 11 14:07:22 1999
Date: Thu, 11 Mar 99 11:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 11 Mar 1999 Volume: 8 Number: 5111
Today's topics:
ANNOUNCE: Apache-CIPP_Handler-0.06 <joern@dimedis.de>
ANNOUNCE: CIPP-1.90 <joern@dimedis.de>
Announce: Parse-Yapp-0.22 released <desar@club-internet.fr>
Re: BigInt: Decimal to Hex <jeromeo@atrieva.com>
building socksified perl nesbit@gte.net
can I integrate javascript into cgi output? <geotrace@shentel.net>
Re: can I integrate javascript into cgi output? <webmaster@cgninteractive.com>
Re: Can't Increment Counter in FILE Using http:// (George Crissman)
Re: Can't Increment Counter in FILE Using http:// (Abigail)
Re: Can't Increment Counter in FILE Using http:// <revjack@radix.net>
CGI https-detector <webmaster@cgninteractive.com>
Re: CGI https-detector (brian d foy)
CGI.pm - parameter count? k_mcdermott@my-dejanews.com
Database thru Perl <tszeto@mindspring.com>
Re: Databases & Perl snay@redbox.caroline.net
Delete Text Block Between a pair of Parenthesis kqchung@my-dejanews.com
Devel::Modlist 0.2 available on CPAN (Randy J. Ray)
Re: does perl discourage obfuscated code? (was Re: Perl <jeromeo@atrieva.com>
Re: Help modifying 'null' elements ?! (Tad McClellan)
Re: Help modifying 'null' elements ?! <aqumsieh@matrox.com>
Re: Help modifying 'null' elements ?! <aqumsieh@matrox.com>
Re: Help with basic perl problems. <gsx97@usa.net>
Re: Help with basic perl problems. <honky@best.com>
Re: I want to know where I can get a sendmail program t dragnovich@my-dejanews.com
Image::Size 2.901 uploaded to PAUSE (Randy J. Ray)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Mar 1999 18:38:45 GMT
From: Joern Reder <joern@dimedis.de>
Subject: ANNOUNCE: Apache-CIPP_Handler-0.06
Message-Id: <7c92jl$c5l$1@play.inetarena.com>
file: $CPAN/authors/id/J/JR/JRED/Apache-CIPP_Handler-0.06.tar.gz
size: 5280 bytes
md5: 6eca228ffc12b02943fa41867a0d5a17
Apache::CIPP_Handler - CIPP Apache Request Module by Joern Reder
Copyright (c) 1998-1999 dimedis GmbH, Germany
This library ist free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
$Id: README,v 1.3 1999/01/16 14:32:32 joern Exp $
WHAT IS Apache::CIPP_Handler?
This module uses the Apache mod_perl interface to register
CIPP sources to Apache. So you let Apache execute CIPP sources
on the fly.
WHAT IS CIPP?
Download CIPP from CPAN or http://spirit.dimedis.de/ and
read its README and documentation ;)
WHAT DO YOU NEED TO USE Apache::CIPP_Handler
You must have a running Apache mod_perl environment. Apache
1.2.6 and 1.3.x or better are supported.
Also you must have the CIPP module package installed.
WHICH PLATFORMS ARE SUPPORTED
Apache::CIPP_Handler has only be tested under Unix platforms.
I don't know, if it will run on the Win32 platforms.
DOWNLOAD Apache::CIPP_Handler
Apache::CIPP_Handler and CIPP can be downloaded from CPAN
$CPAN/authors/id/J/JR/JRED
or (in future) from the spirit website.
http://spirit.dimedis.de/
(this site will start March 1999)
INSTALLING Apache::CIPP_Handler
perl Makefile.PL
make
make install
DOCUMENTATION
Apache configuration information is embedded as POD in
Apache::CIPP_Handler.pm so you can read it using perldoc.
BUG REPORTING
Please send any bug reports or comments to
cipp-bug@dimedis.de
or use the bug report formular on the spirit website
http://spirit.dimedis.de/
(this site will start March 1999)
You can speak german with us, but we understand english, too ;)
------------------------------
Date: 11 Mar 1999 18:39:04 GMT
From: Joern Reder <joern@dimedis.de>
Subject: ANNOUNCE: CIPP-1.90
Message-Id: <7c92k8$cce$1@play.inetarena.com>
file: $CPAN/authors/id/J/JR/JRED/CIPP-1.90.tar.gz
size: 34972 bytes
md5: 8e8feafcd8f59a0f0d69796897108f5e
CIPP - CgI Perl Preprocessor by Joern Reder
Copyright (c) 1997-1999 dimedis GmbH, Germany
This library ist free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
$Id: README,v 1.4 1999/01/18 14:47:15 joern Exp $
WHAT IS CIPP?
CIPP is a perl module for translating CIPP sources to pure perl
programs. CIPP defines a HTML embedding language called CIPP
which has powerful features for CGI and database developers.
Many standard CGI- and database operations (and much more)
are covered by CIPP, so the developer has no need to code
them again and again.
CIPP is useful in two ways. One aproach is to let CIPP generate
standalone CGI scripts, which only need a little environment to
run (some configuration files). If you want to use CIPP in this
way: there is a complete development environment called spirit
which supports you in many ways, to develop such CGI programms
with CIPP. spirit can be downloaded from CPAN, but is only free
for non commercial usage.
The second is to use the Apache::CIPP_Handler module. This module
defines an Apache request handler for CIPP sources, so they will
be executed in an Apache environment on the fly, with a two-level
cache and great performance. The Apache::CIPP_Handler module
is free software.
WHAT DO YOU NEED TO USE CIPP
CIPP itself needs perl 5.004_01 or better. To use its database
interface you must have installed the DBI module (somewhat
better than version 0.97) and a DBD-module for your database
system.
CIPP is a pure perl module, so you need no C compiler.
WHICH PLATFORMS ARE SUPPORTED
CIPP runs on any Unix system with a perl interpreter.
The Win32 platforms are not tested yet very well but most
functions should run ok.
DOWNLOAD CIPP
CIPP (and also spirit mentioned above) can be downloaded
from CPAN
$CPAN/authors/id/J/JR/JRED
or (in future) from the spirit website.
http://spirit.dimedis.de/
(this site will start March 1999)
INSTALLING CIPP
perl Makefile.PL
make
make install
DOCUMENTATION
Technical information about the usage of the CIPP.pm module
is embedded as POD in CIPP.pm and can be retrieved with
"perldoc CIPP". You will not need this information, if you
use CIPP either with Apache::CIPP_Handler or spirit.
The CIPP language reference manual can be downloaded from CPAN as
an extra package. This is usefull, because the format of the
documentation is PDF and the uncompressed file has more than 500kb.
Also not every modification of CIPP leads to modification of
the documentation.
SUPPORTED LANGUAGES
When the development of CIPP started (spring 1997), there was no
idea to publish it, as it was designed for spirit, and spirit
was intended for internal use only.
So the documentation and all CIPP messages are in german language.
As soon as possible we want to provide an english version, too.
SIMPLE EXAMPLE
Here is a simple example of using CIPP in an HTML source to
retrieve some information from a database. Think this as a
HTML page which will be executed on the fly in an Apache
environment or will be converted to a standalone CGI script.
Note: there is no code to connect to the database. This is
done implicitely. The configuration is taken from Apache
or from an external configuration file, if you use the CGI
standalone version of CIPP.
<HTML>
<HEAD><TITLE>tiny litte CIPP example</TITLE></HEAD>
<BODY>
<H1>tiny litte CIPP example</H1>
<P>
<TABLE BORDER=1>
<TR><TD>Name</TD><TD>Adress</TD><TD>Phone</TD></TR>
<?SQL SQL="select name, adress, phone from people"
MY VAR="$n, $a, $p">
<TR><TD>$n</TD><TD>$a</TD><TD>$p</TD></TR>
<?/SQL>
</TABLE>
</BODY>
</HTML>
BUG REPORTING
Please send any bug reports or comments to
cipp-bug@dimedis.de
or use the bug report formular on the spirit website
http://spirit.dimedis.de/
(this site will start March 1999)
You can speak german with us, but we understand english, too ;)
------------------------------
Date: 11 Mar 1999 18:33:31 GMT
From: Francois Desarmenien <desar@club-internet.fr>
Subject: Announce: Parse-Yapp-0.22 released
Message-Id: <7c929r$c1m$1@play.inetarena.com>
Parse-Yapp-0.22 has just been uploaded to CPAN. It should be
available soon on your nearest CPAN mirror.
This release is a bug fix for a weird problem when encountering
conflicts whith non-associative tokens.
As prior version could generate bogus DFA tables, if you're using
Parse::Yapp, I suggest you upgrade ASAP.
Sorry for the inconvenience, but nobody's prefect, neither programs are :-)
By the same, if you could drop me an email just telling me you use
Parse::Yapp, it would help me to know the impact of such problems.
Enjoy,
Frangois Disarminien
Here is the README file:
Parse::Yapp - Parse::Yapp Yet Another Perl Parser compiler
Compiles yacc-like LALR grammars to generate Perl OO parser modules.
COPYRIGHT
(c) 1998 Francois Desarmenien, all rights reserved.
(see the Copyright section in Yapp.pm for usage and distribution rights)
IMPORTANT NOTES
THIS IS BETA SOFTWARE.
Though it has been tested a lot, there are probably bugs in it ;-)
The BETA status does not reflect the quality of the code, but the possible
changes in the generated parser modules.
I need FEEDBACK for every problem or bug you could encounter so I can fix
them in the next release. Comments are welcome too.
But I also need FEEDBACK if you use it and have it work fine so I can step
to production releases. Just drop me a mail.
The Parse::Yapp pod section is the main documentation and it assumes
you already have a good knowledge of yacc. If not, I suggest the GNU
Bison manual which is a very good tutorial to LALR parsing and yacc's
grammar syntax.
The documentation is only a draft and should be rewritten (I think).
Any help on this issue would be very welcome.
DESCRIPTION
This is the alpha release 0.22 of the Parse::Yapp parser generator.
It lets you create Perl OO fully reentrant LALR(1) parser
modules (see the Yapp.pm pod pages for more details) and has
been designed to be functionnaly as close as possible to yacc,
but using the full power of Perl and opened for enhancements.
REQUIREMENTS
Requires perl5.004 or better :)
It is written only in Perl, with standard distribution modules,
so you don't need any compiler nor special modules.
INSTALLATION
perl Makefile.PL
make
make test
make install
WARRANTY
This software comes with absolutly NO WARRANTY of any kind.
I just hope it can be useful.
FEEDBACK
Send feedback, comments and bug reports to:
Francois Desarmenien
desar@club-internet.fr
------------------------------
Date: Thu, 11 Mar 1999 09:21:30 -0800
From: "Jerome O'Neil" <jeromeo@atrieva.com>
Subject: Re: BigInt: Decimal to Hex
Message-Id: <36E7FB9A.BA8A7F79@atrieva.com>
I'd like to thank everyone who responded to this.
Besides reaffirming my basic faith in humanity, you are all now a small
part of a new munition!
Thanks!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Thu, 11 Mar 1999 18:06:31 GMT
From: nesbit@gte.net
Subject: building socksified perl
Message-Id: <7c90mu$dhr$1@nnrp1.dejanews.com>
Hello,
I'm trying to use/build Perl5.004 and/or Perl5.005_02 with SOCKS5.
I've added the following during the 'Configure' script prompts:
-DSOCKS
-L<socks_lib_dir> -lsocks5
and even tried to remap using:
-DRconnect=SOCKSconnect \
-DRgetsockname=SOCKSgetsockname \
-DRgetpeername=SOCKSgetpeername \
-DRbind=SOCKSbind \
-DRaccept=SOCKSaccept \
-DRlisten=SOCKSlisten \
-DRselect=SOCKSselect \
-Drecvfrom=SOCKSrecvfrom \
-Dsendto=SOCKSsendto \
-Drecv=SOCKSrecv \
-Dsend=SOCKSsend \
-Dread=SOCKSread \
-Dwrite=SOCKSwrite \
-Drresvport=SOCKSrresvport \
-Dshutdown=SOCKSshutdown \
-Dlisten=SOCKSlisten \
-Dclose=SOCKSclose \
-Ddup=SOCKSdup \
-Ddup2=SOCKSdup2 \
-Dfclose=SOCKSfclose \
-Dgethostbyname=SOCKSgethostbyname
Also tried using 'runsocks' but that doesn't work either.
TIA.
N.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 11:55:48 -0500
From: Diane Unger <geotrace@shentel.net>
Subject: can I integrate javascript into cgi output?
Message-Id: <36E7F594.763D899D@shentel.net>
Is it possible to include javascript in the output of a perl cgi
program? I've been trying it and have been unable to get javascript
that works elsewhere (without cgi) to work as part of the output of
cgi. Any tricks to be aware of?
Thanks,
D.
------------------------------
Date: Thu, 11 Mar 1999 13:29:11 -0500
From: Spaghettio <webmaster@cgninteractive.com>
Subject: Re: can I integrate javascript into cgi output?
Message-Id: <36E80B77.C9079843@cgninteractive.com>
Yes, it's possible. You'll have to use a lot of backslashes to escape
quotes, brackets, etc.
> Is it possible to include javascript in the output of a perl cgi
> program? I've been trying it and have been unable to get javascript
> that works elsewhere (without cgi) to work as part of the output of
> cgi. Any tricks to be aware of?
> Thanks,
> D.
Mssr. Spag. Reverso
webmaster@cgninteractive.com
------------------------------
Date: Thu, 11 Mar 1999 17:25:25 GMT
From: strads@tmisnet.com (George Crissman)
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <36e7fc7f.4534893@news2.tmisnet.com>
Hmmmm ... I looked in the error file and found a bunch of '@' signs.
Didn't seem too instructive. I've started with the URL you
recommended -- hit the "Big Dummy's Guide" first -- and ran
the program with the -w switch active. Results:
** Several Warnings of variables only used once.
** More Warnings of uninitialized variable use.
That will keep me busy for the rest of the day!
However:
I decided to try the command from the command line,
(as opposed to running the program from the command line)
and here's what came back:
<9> % perl if (-e "syscount.txt") then { print "yahoo!\n\n" ; }
Badly placed ()'s.
<10> % perl if (-e ("syscount.txt")) then { print "yahoo!\n\n " ; }
Badly placed ()'s.
It looks like I've got a parentheses problem, but don't know exactly
how to cure it. It didn't complain about the curly braces (it's just
a placeholder for debugging purposes at this point) -- what could be
wrong with the parentheses after the "if" ?
A quick look at "Learning Perl" (2nd Edition, page 112, "The -x File
Tests") clearly shows shows the parentheses in the sample code.
The system I'm running on appears to be the BSD flavor of unix.
It does *not* like the -e command at the command prompt. Could it
be that Perl is handing the -e test directly to the OS and generating
the error that way?
Thanks for your suggestions and advice!
-- George Crissman
-- strads@tmisnet.com
On Thu, 11 Mar 1999 10:18:40 -0500, comdog@computerdog.com (brian d
foy) wrote:
>In article <36205783.7562027@news2.tmisnet.com>, strads@tmisnet.com (George Crissman) posted:
>
>> The good news: it WORKS in telnet mode based in the
>> cgi-bin directory.
>> The bad news: it DOESN'T work in http:// mode from my browser.
>
>> Partial success is worse than complete failure, because I have
>> no clue how to proceed with my debugging.
>
>check the return values of function calls and look for errors in the
>error log. you might also check the FAQs referenced in the CGI
>Meta FAQ.
>
>--
>brian d foy
>CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
-----------------------------------------------------------------------
"There is no need to criminalize millions of legitimate and responsible
businesses and individuals in order to stop a very small group of
irresponsible people, particularly when there are other ways already
working ." says Mr. Dan Hufnal of the 10,000 member DEAA
<http://www.deaa.com>. What does he mean by "already working"?
Maybe: <http://www.tmisnet.com/~strads/spamhunt/index.html>
-----------------------------------------------------------------------
------------------------------
Date: 11 Mar 1999 18:16:24 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <7c919o$ar2$1@client2.news.psi.net>
George Crissman (strads@tmisnet.com) wrote on MMXVIII September MCMXCIII
in <URL:news:36205783.7562027@news2.tmisnet.com>:
|| Greetings!
||
|| I'm developing an application that keeps a serial number in a file
|| named <syscount.txt>. The program is supposed to read the number,
|| increment it, and save it back into the file for next time. The
|| program fragment shown below performs this task.
||
|| The good news: it WORKS in telnet mode based in the
|| cgi-bin directory.
|| The bad news: it DOESN'T work in http:// mode from my browser.
|| More bad news: it's supposed to work using http:// access.
Then it isn't a Perl problem, is it?
Of course, your program is hopelessly wrong, unless you can garantee
you never have 2 people visiting your site at nearly the same time.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: 11 Mar 1999 18:42:59 GMT
From: Judith Patrice <revjack@radix.net>
Subject: Re: Can't Increment Counter in FILE Using http://
Message-Id: <7c92rj$luj$2@news1.Radix.Net>
Keywords: Hexapodia as the key insight
George Crissman explains it all:
: <9> % perl if (-e "syscount.txt") then { print "yahoo!\n\n" ; }
^ ^^^^
1) try perl -e 'commands'
2) There's no "then" in an "if" statement
:Badly placed ()'s.
That may be your shell talking to you.
--
perl -e 'while(<>){$f.= $_}@l=split(/\s+/, $f);for($i=0;$i<@l-1;$i++){$W{$l[$i]
}.=" ".$l[$i+1];}sub a{$w=$l[1]}&a;sub b{print "\n"}while($w){if(!($W{$w})){&b;
&b;&a;last if ($q++>3);}print"$w ";@p=split(/ /,$W{$w});$c=@p;until($s=int(rand
($c))){1}$w=$p[$s]}&b' big_text_file
------------------------------
Date: Thu, 11 Mar 1999 13:25:04 -0500
From: Spaghettio <webmaster@cgninteractive.com>
Subject: CGI https-detector
Message-Id: <36E80A80.C90DB0E9@cgninteractive.com>
Can anyone tell me where I can find a script that detects whether or not
a browser can handle https protocol? I've searched CPAN, but have come
up confused and empty-handed.
TIA,
Mssr. Spag. Reverso
webmaster@cgninteractive.com
------------------------------
Date: Thu, 11 Mar 1999 13:49:24 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI https-detector
Message-Id: <comdog-ya02408000R1103991349240001@news.panix.com>
In article <36E80A80.C90DB0E9@cgninteractive.com>, Spaghettio <webmaster@cgninteractive.com> posted:
> Can anyone tell me where I can find a script that detects whether or not
> a browser can handle https protocol? I've searched CPAN, but have come
> up confused and empty-handed.
don't bother. let the server worry about establishing an SSL
connection.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 11 Mar 1999 17:39:46 GMT
From: k_mcdermott@my-dejanews.com
Subject: CGI.pm - parameter count?
Message-Id: <7c8v51$bt6$1@nnrp1.dejanews.com>
Hi,
I have a couple of scripts that create forms and then have an 'opposite
number' which processes the output of the form.
I was wanting to combine these into one script, to create and then process the
form.
Is this possible?
I had thought that the number of parameters would be useful since the creator,
only has one parameter and the form processor has many, but I can't get
the number of parameters out?
Can anyone help...
TIA
Kevin
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 11 Mar 1999 10:50:12 +0000
From: tszeto <tszeto@mindspring.com>
Subject: Database thru Perl
Message-Id: <36E79FE3.DB1BD87E@mindspring.com>
Is there a good book on how to access and manipulate
database files (Microsoft Access) using Perl/Cgi ?
Thanks in advance.
Ted
tszeto@mindspring.com
------------------------------
Date: 11 Mar 1999 08:40:18 -0800
From: snay@redbox.caroline.net
Subject: Re: Databases & Perl
Message-Id: <m1yal4t1xp.fsf@redbox.caroline.net>
You can connect your perl script to Access via ODBC... check CPAN.
Check out DBI + DBD::ODBC... Make sure you have your ODBC setup
locally... In the future, questions this simple are what dejanews
was made for, go to power search, punch in "access odbc perl" you
wouldn't have had to wait for me to post a reply, and you wouldn't
have had to endure this one huge sentence.
Shane...
------------------------------
Date: Thu, 11 Mar 1999 17:59:05 GMT
From: kqchung@my-dejanews.com
Subject: Delete Text Block Between a pair of Parenthesis
Message-Id: <7c9092$d1g$1@nnrp1.dejanews.com>
Hello All,
I have block of text that needs to be removed from a file.
At the present, I have to do it interactively in vi by using
the "%" command. I just wonder if you can help me to implement
this in Perl. Here is an example:
Before
------
(savetext
(deletetext
(sdfds)
((ffdffdfads)
(dfsffdsfff))
) # close parenthesis for deletetext
) # close parenthesis for savetext
After
-----
(savetext
)
I am sorry if this question had been asked in the past. If
it is could you give me a pointer to that article.
Thank you so much.
Kevin,
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 11 Mar 1999 18:33:52 GMT
From: rjray@tsoft.com (Randy J. Ray)
Subject: Devel::Modlist 0.2 available on CPAN
Message-Id: <7c92ag$c1n$1@play.inetarena.com>
(This was not announced when first released, as I wanted to make sure it was
a fairly stable package, first)
I have a late-alpha/early-beta of a module-dependancy-listing package on CPAN,
called Devel::Modlist. I don't have a full set of support files like I use
with my other packages, so this announcement will have to be improv'd :-).
The Devel::Modlist package is intended to list, after execution, the modules
that you script made use of. An example usage:
{ tremere:132 } perl -d:Modlist /usr/bin/imgsize ~/svsm.gif
WIDTH=192 HEIGHT=192
AutoLoader
Exporter
Getopt::Std
Image::Size 2.10
Symbol 1.02
strict 1.01
vars
Where discernable, the version of the module is also reported. There are a
couple of options to tailor and/or reduce the output. The package does come
with a reasonable manual page, so users aren't left completely in the dark.
I recently used this package to cut the number of loaded files used by my
Image::Size package by nearly half. What you see above is post-streamlining.
The original set of dependancies included IO::File, which used DynaLoader and
Carp... etc.
The package may be found under either my id (RJRAY) or by name under the
Devel/ area.
Randy
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray rjray@tsoft.com
Campbell, CA randy@byz.org
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>
------------------------------
Date: Thu, 11 Mar 1999 08:57:59 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: does perl discourage obfuscated code? (was Re: Perl evangelism)
Message-Id: <36E7F617.A835AFB4@atrieva.com>
Russell Schulz wrote:
>
> Jerome O'Neil <jeromeo@atrieva.com> writes:
> > I'll state it again, just so you don't misunderstand me. Perl allows
> > one to write *more* readable code.
>
> ... with extra discipline.
Russell, for any meaningful discourse to take place, you're going to
have to allow me to add (or not) the caveats and amendments to my
statements. In this particular instance, the period at the end of the
statement is there for a reason.
So, once again, I'll clarify:
Perl allows one to write *more* readable code.
Unreadable code is a function of undisciplined programmers. Perl has
nothing to do with it, other than to say "Of the code generated by any
given programmer P, of discipline D, Perl's readability R will usually
be higher."
As a rule:
R^perl(PD) > R^sumpinelse(PD).
> isn't that what I've been saying the whole thread?
No. You said:
Russell> I believe it. Perl encourages hard-to-read code. that's
Russell> just the way it is, and if you don't apply a strong
Russell> discipline when writing Perl, you're going to be the proud
Russell> owner of a ton of read-only code.
s/Perl/Any Language You Care To Mention/;
> your claim is now that for some tasks, Perl code
> is MORE readable than any other possible code.
Now you're just plain old puttin' words in my mouth. Here it is, one
more time.
Perl allows one to write *more* readable code.
Repeat as necessary.
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Thu, 11 Mar 1999 06:23:16 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help modifying 'null' elements ?!
Message-Id: <4398c7.uj8.ln@magna.metronet.com>
Jamie@worldweb.demon.co.uk wrote:
: I'm learning Perl and have come up against a problem that I cannot solve. I'm
: sure it's simple when you know how, though!
This should do it then:
perldoc -f defined
: I've got a list of lists. This lol is built up from the return values of a
: select from a database. Some of these values are 'null'. I want to loop
: through the lol and for each 'null' value, set it to the text string
: '<null>'.
: I've tried the following:
: my @row
: while (@row = $sth->fetchrow_array) {
: foreach $item (@row) {
: if ($item == undef) {$item = '<null>'}
^^
You are doing a numeric comparsion there, so Perl DWIMs undef
into a number (zero), and then does the comparison.
You can replace that line with something like:
$item = '<null>' unless defined $item;
: }
: }
: This sets *some* values to <null>, including those values I'd expect to be
: set to <null> but it also sets a whole load more to <null> too! So I'm losing
: data!!!
I hope the lost ones all were zero or the empty string
(which would also gets converted to a zero when a number
is called for), else I don't know how to explain losing them...
: Could someone help me with this by telling me what is wrong with my approach
: here ?
Doing a numeric compare on something that is not numeric.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 11 Mar 1999 11:05:07 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
To: Jamie@worldweb.demon.co.uk
Subject: Re: Help modifying 'null' elements ?!
Message-Id: <x3ysobcdnbg.fsf@tigre.matrox.com>
Jamie@worldweb.demon.co.uk writes:
> my @row
missing semicolon
> while (@row = $sth->fetchrow_array) {
> foreach $item (@row) {
> if ($item == undef) {$item = '<null>'}
if (defined $item) { .. }
> }
> }
HTH,
Ala
------------------------------
Date: Thu, 11 Mar 1999 11:07:53 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Help modifying 'null' elements ?!
Message-Id: <x3ypv6gdn6u.fsf@tigre.matrox.com>
Ala Qumsieh <aqumsieh@matrox.com> writes:
> > if ($item == undef) {$item = '<null>'}
>
> if (defined $item) { .. }
Silly me .. of course that should've been:
unless (defined $item) { .. }
------------------------------
Date: Thu, 11 Mar 1999 12:32:24 -0500
From: "J. Parsons" <gsx97@usa.net>
Subject: Re: Help with basic perl problems.
Message-Id: <7c8ulo$cks@news1.snet.net>
Try changing your chmod to 755.
>Set the rights on the .cgi script
>chmod 750 Test.cgi
------------------------------
Date: Thu, 11 Mar 1999 10:42:47 -0800
From: "David Dodd" <honky@best.com>
Subject: Re: Help with basic perl problems.
Message-Id: <7c92fo$6bc$1@news2.symantec.com>
Thanks for all your help. The problem ended up being the control characters
at the end of lines. I switched my editor to save for Unix and the scripts
ran fine!
What editor is recommened?
Thanks,
Dave
Frank Varnavas wrote in message <36E77362.AAEE9795@iname.com>...
>does it run from the command line?
>is mode 750 really what you want for a cgi script?
>
>
>David Dodd wrote:
>>
>> Hi,
>>
>> I am just starting out and can not get my first perl script running.
This
>> is what I have done.
>>
>>
>> Set the rights on the .cgi script
>> chmod 750 Test.cgi
>>
>> Tried to run the script and I can not figure out how to get it to run.
Is
>>
------------------------------
Date: Thu, 11 Mar 1999 17:03:56 GMT
From: dragnovich@my-dejanews.com
To: "Rollo Lawson" <rollo@enter.net>
Subject: Re: I want to know where I can get a sendmail program that will work with NT.
Message-Id: <7c8t1l$9vh$1@nnrp1.dejanews.com>
I recomend you to make a Perl routine to send the email, so you can make your
programs send mail under any plataform that has a perl 5.0 or more on it.
You can find many infiormation about sending email with perl in Windows perl
(activestate/suport/Faq/) WinPerl Faq 5,6, or 7 (Refer to the topic how to
send email from perl)
There are some examples of how to send email and even, there are some links to
other perl programers that has some already free routines. That you can
use/modify for your programs.
See you!
In article <36e6f07a.0@news3.enter.net>,
"Rollo Lawson" <rollo@enter.net> wrote:
> Iam a new programmer to perl, and I was wondering where I can get a simple
> program that sends mail
> in an NT web environment. Does anybody have a Url or ftp that has one that
> will work please help
>
> rollo lawson
> rollo@enter.net
>
>
------------------------
Juan Carlos Lopez
QDesigns President & CEO
http://www.qdesigns.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 11 Mar 1999 18:32:22 GMT
From: rjray@tsoft.com (Randy J. Ray)
Subject: Image::Size 2.901 uploaded to PAUSE
Message-Id: <7c927m$c1f$1@play.inetarena.com>
(I originally released this package as 2.10, not realizing that CPAN uses
direct numerical comparisons, and thus 2.10 < 2.9).
Version 2.901 of Image::Size has been uploaded to PAUSE, and will propagate
to all CPAN sites over the next few days.
To build and install, you will need perl 5.002 or later, and sufficient
access to install an extension.
Summary of Changes in 2.901:
* Use of the Devel::Modlist package showed that my usage of IO::File pulled
in a lot of overhead (which I knew, but this meant I couldn't ignore it
any longer). Pulled out all IO::File stuff, use the Symbol package instead
for anonymous GLOBs. Also, the calling form that allows an open filehandle
be passed in is no longer so picky that it be blessed into IO::File. It
does have to be a hard reference, though. Symbolic refs still look like
filenames.
* While doing the above, I eliminated the last of the strict-refs conflicts.
Prior to now, the package ran under strict subs and vars, but not refs. It
is now fully strict-clean.
>From the README file for 2.901:
Image::Size is a library based on the image-sizing code in the wwwimagesize
script, a tool that analyzes HTML files and adds HEIGHT and WIDTH tags to
IMG directives. Image::Size has generalized that code to return a raw (X, Y)
pair, and included wrappers to pre-format that output into either HTML or a
set of attribute pairs suitable for the CGI.pm library by Lincoln Stein.
Currently, Image::Size can size images in XPM, XBM, GIF, JPEG, TIFF, PNG and
the PPM family of formats (PPM/PGM/PBM).
I did this because my old WWW server generated a lot of documents on demand
rather than keeping them in static files. These documents not only used
directional icons and buttons, but other graphics to annotate and highlight
sections of the text. Without size attributes, browsers cannot render the
text of a page until the image data is loaded and the size known for layout.
This library enables scripts to size their images at run-time and include
that as part of the generated HTML. Or for any other utility that uses and
manipulates graphics. The idea of the basic interface + wrappers is to not
limit the programmer to a certain data format.
Please send any reports of problems or bugs to rjray@tsoft.com.
This package is copyright (c) 1998 by Randy Ray (rjray@tsoft.com) and is
made available to the Perl public under terms of the Artistic License used to
cover Perl itself. See the file Artistic in the distribution of Perl 5.002 or
later for details of copy and distribution terms.
Perl module interface by Randy J. Ray (rjray@tsoft.com), original
image-sizing code by Alex Knowles (alex@ed.ac.uk) and Andrew Tong
(werdna@ugcs.caltech.edu), used with their joint permission.
Some bug fixes submitted by Bernd Leibing <bernd.leibing@rz.uni-ulm.de>.
PPM/PGM/PBM sizing code contributed by Carsten Dominik
<dominik@strw.LeidenUniv.nl>. Tom Metro <tmetro@vl.com> re-wrote the JPG
and PNG code, and also provided a PNG image for the test suite. Dan Klein
<dvk@lonewolf.com> contributed a re-write of the GIF code. Cloyce Spradling
<cloyce@headgear.org> contributed the TIFF sizing code and test images.
A fix for reading binary data on PC-ish operating systems was contributed by
Silas Dunsmore <silasd@psyber.com>. Aldo Calpini <a.calpini@romagiubileo.it>
sent in code that was easily adapted to support BMP images (Windows bitmaps).
Fix for a recurring problem with GIF87a files contributed by Matthias Schmitt
<matthias.schmitt@mmp.lu>. Fix for problems with PPM formats on some Win32
versions was contributed by Randy Kobes <randy@theory.uwinnipeg.ca>.
--
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Randy J. Ray rjray@tsoft.com
Campbell, CA randy@byz.org
<A HREF="http://www.svsm.org">Silicon Valley Scale Modelers</A>
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5111
**************************************