[25222] in Perl-Users-Digest
Perl-Users Digest, Issue: 7467 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 30 18:05:45 2004
Date: Tue, 30 Nov 2004 15:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 30 Nov 2004 Volume: 10 Number: 7467
Today's topics:
Re: can't install DBD::mysql - missing mysql.h? <mothra@nowhereatall.com>
Re: dmake.exe: Error code 255, while making 'test' <thirault@liberation.fr>
Re: dmake.exe: Error code 255, while making 'test' <mjcarman@mchsi.com>
FAQ 8.44: How do I tell the difference between errors f <comdog@panix.com>
Re: how to manage phpBB, windows 2003 server and FreeBS <bik.mido@tiscalinet.it>
Passing huge double arrays in XML-RPC <zapata@hotmail.com>
Re: Passing huge double arrays in XML-RPC <perl@my-header.org>
Re: Passing huge double arrays in XML-RPC <zapata@hotmail.com>
Re: perl trim function <uri@stemsystems.com>
Re: perl trim function <tassilo.von.parseval@rwth-aachen.de>
Re: perl trim function <uri@stemsystems.com>
smtpprox and postfix <spam.me@offizi.nl>
Re: SQLite - problem connecting to database (or doing a <spamtrap@dot-app.org>
Re: SQLite - problem connecting to database (or doing a <spamtrap@dot-app.org>
Re: SQLite - problem connecting to database (or doing a <nospam@nospam.com>
Re: SQLite - problem connecting to database (or doing a <spamtrap@dot-app.org>
Re: System command <jgibson@mail.arc.nasa.gov>
Re: System command <eon@hotmail.com>
Re: Transiting from Perl: Learn Python or Ruby? <No_4@dsl.pipex.com>
Re: Transiting from Perl: Learn Python or Ruby? <spamtrap@dot-app.org>
Trying to understand Perl <psmith@marine.usf.edu>
Re: Trying to understand Perl <mritty@gmail.com>
Re: Trying to understand Perl <tiroverus@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 30 Nov 2004 11:42:49 -0800
From: "mothra" <mothra@nowhereatall.com>
Subject: Re: can't install DBD::mysql - missing mysql.h?
Message-Id: <41accd1d$1@usenet.ugs.com>
Hi Alex,
"Alex Hunsley" <lardattardisdoteddotacdotuk@mailinator.com> wrote in message
news:10qp7h0hck2gt52@corp.supernews.com...
> Paul Lalli wrote:
> alex@Glenlivet ~/.cpan/build/DBI-1.46
^^^^^^^^^^^^^^^^^
> $ perl Makefile.PL --cflags=-IC:/tools/mysql-4.1.7/include
You are trying to install DBD-mysql not DBI you need to be in the correct
directory
Something like this works on my system:
F:\perl_modules\DBD-mysql-2.9005_3>perl
makefile.pl --cflags="-Ie:\mysql\include" --libs="-Le:\mysql
\lib -lmysqlclient"
'mysql_config' is not recognized as an internal or external command,
operable program or batch file.
[snipped warnings about mysql_config]
I will use the following settings for compiling and testing:
cflags (Users choice) = -Ie:\mysql\include
libs (Users choice) = -Le:\mysql\lib -lmysqlclient
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testsocket (default ) =
testuser (default ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.
F:\perl_modules\DBD-mysql-2.9005_3>nmake
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
cl -c -IF:/perl/site/5.8.3/lib/MSWin32-x86-multi-thread/auto/DBI -Ie:\mysql
\include -g -no
logo -Gf -W3 -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRY
PT -DPERL_IMPLICIT_CONTE
XT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -MD -DNDEBUG -O1
-DVERSION=\"2.9005_3\"
-DXS_VERSION=\"2.9005_3\"
"-IF:\perl\5.8.3\lib\MSWin32-x86-multi-thread\CORE" dbdimp.c
Command line warning D4002 : ignoring unknown option '-g'
[more snippage]
F:\perl_modules\DBD-mysql-2.9005_3>nmake test
Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
F:\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe
"-MExtUtils::Command::MM" "-e" "test_har
ness(0, 'blib\lib', 'blib\arch')" t\00base.t t\10dsnlist.t t\20createdrop.t
t\30insertfetch.t t\40bi
ndparam.t t\40blobs.t t\40listfields.t t\40nulls.t t\40numrows.t
t\50chopblanks.t t\50commit.t t\60l
eaks.t t\ak-dbd.t t\akmisc.t t\dbdadmin.t t\insertid.t t\mysql.t t\mysql2.t
t\00base...........ok
t\10dsnlist........ok
t\20createdrop.....ok
t\30insertfetch....ok
t\40bindparam......ok
t\40blobs..........ok
t\40listfields.....ok
t\40nulls..........ok
t\40numrows........ok
t\50chopblanks.....ok
t\50commit.........ok
t\60leaks..........skipped
all skipped: $ENV{SLOW_TESTS} is not set or Proc::ProcessTable not
installed
t\ak-dbd...........ok
t\akmisc...........ok
t\dbdadmin.........ok
t\insertid.........ok
t\mysql............ok
t\mysql2...........ok
All tests successful, 1 test skipped.
Files=18, Tests=767, 27 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU)
F:\perl_modules\DBD-mysql-2.9005_3>
I hope this helps.
Mothra
------------------------------
Date: Tue, 30 Nov 2004 20:47:36 +0100
From: "tt" <thirault@liberation.fr>
Subject: Re: dmake.exe: Error code 255, while making 'test'
Message-Id: <coiipd$la$1@s5.feed.news.oleane.net>
Hello,
I don't understand. The text before your words is just filled withe
underscores.
???!!???
Thanks
t
"Ben Morrow" <usenet@morrow.me.uk> a écrit dans le message de news:
eckp72-ts4.ln1@osiris.mauzo.dyndns.org...
>
> Quoth "tt" <thirault@liberation.fr>:
>> -=-=-=-=-=-
>> [Alternative: text/html]
>
> Don't do that.
>
>> -=-=-=-=-=-
>> -=-=-=-=-=-
>> [Attachment type=image/gif, name=BlankBkgrd.gif]
>
> And *certainly* don't do that.
>
> Ben
>
> --
> Musica Dei donum optimi, trahit homines, trahit deos. |
> Musica truces molit animos, tristesque mentes erigit. |
> ben@morrow.me.uk
> Musica vel ipsas arbores et horridas movet feras. |
------------------------------
Date: Tue, 30 Nov 2004 16:16:36 -0600
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: dmake.exe: Error code 255, while making 'test'
Message-Id: <coirg7$2vs1@onews.rockwellcollins.com>
Please don't top-post. Place your comments *after* the text you are
replying to. [post reordered]
tt wrote:
>
> "Ben Morrow" <usenet@morrow.me.uk> a écrit dans le message de news:
> eckp72-ts4.ln1@osiris.mauzo.dyndns.org...
>
>> Quoth "tt" <thirault@liberation.fr>:
>>>
>>> [Alternative: text/html]
>>
>> Don't do that.
>>
>>> [Attachment type=image/gif, name=BlankBkgrd.gif]
>>
>> And *certainly* don't do that.
>
> I don't understand.
Usenet is a textual medium. Don't post markup (like HTML). Not everyone
is using a newsreader that understands such things. Similarly, don't
post binaries (like images). [There are newsgroups where posting of
binaries is permitted, but these usually have "binaries" somewhere in
their name.]
-mjc
------------------------------
Date: Tue, 30 Nov 2004 23:03:02 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 8.44: How do I tell the difference between errors from the shell and perl?
Message-Id: <coiu75$t2u$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
8.44: How do I tell the difference between errors from the shell and perl?
(answer contributed by brian d foy, "<bdfoy@cpan.org>"
When you run a Perl script, something else is running the script for
you, and that something else may output error messages. The script might
emit its own warnings and error messages. Most of the time you cannot
tell who said what.
You probably cannot fix the thing that runs perl, but you can change how
perl outputs its warnings by defining a custom warning and die
functions.
Consider this script, which has an error you may not notice immediately.
#!/usr/locl/bin/perl
print "Hello World\n";
I get an error when I run this from my shell (which happens to be bash).
That may look like perl forgot it has a print() function, but my shebang
line is not the path to perl, so the shell runs the script, and I get
the error.
$ ./test
./test: line 3: print: command not found
A quick and dirty fix involves a little bit of code, but this may be all
you need to figure out the problem.
#!/usr/bin/perl -w
BEGIN {
$SIG{__WARN__} = sub{ print STDERR "Perl: ", @_; };
$SIG{__DIE__} = sub{ print STDERR "Perl: ", @_; exit 1};
}
$a = 1 + undef;
$x / 0;
__END__
The perl message comes out with "Perl" in front. The BEGIN block works
at compile time so all of the compilation errors and warnings get the
"Perl:" prefix too.
Perl: Useless use of division (/) in void context at ./test line 9.
Perl: Name "main::a" used only once: possible typo at ./test line 8.
Perl: Name "main::x" used only once: possible typo at ./test line 9.
Perl: Use of uninitialized value in addition (+) at ./test line 8.
Perl: Use of uninitialized value in division (/) at ./test line 9.
Perl: Illegal division by zero at ./test line 9.
Perl: Illegal division by zero at -e line 3.
If I don't see that "Perl:", it's not from perl.
You could also just know all the perl errors, and although there are
some people who may know all of them, you probably don't. However, they
all should be in the perldiag manpage. If you don't find the error in
there, it probably isn't a perl error.
Looking up every message is not the easiest way, so let perl to do it
for you. Use the diagnostics pragma with turns perl's normal messages
into longer discussions on the topic.
use diagnostics;
If you don't get a paragraph or two of expanded discussion, it might not
be perl's message.
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Tue, 30 Nov 2004 20:19:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: how to manage phpBB, windows 2003 server and FreeBSD user accounts simultaneously.
Message-Id: <lshpq059l777fi7fmsaptenemdsdj9vjhl@4ax.com>
On 29 Nov 2004 20:18:01 -0800, jiing.deng@gmail.com (jiing) wrote:
>I want to write a program which can manage phpBB, windows 2003 server
^^^^^
^^^^^
>and FreeBSD user accounts simultaneously.
> Where can I find related information? Could you show me the
>direction?
> any related CPAN modules
I may be wrong, but are you sure phpBB has anything to do with CPAN,
let alone Perl?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Tue, 30 Nov 2004 14:22:04 -0500
From: "zapata" <zapata@hotmail.com>
Subject: Passing huge double arrays in XML-RPC
Message-Id: <coih93$q5f$1@ngspool-d02.news.aol.com>
I am trying to call a server from a Perl client using the Frontier XML-RPC
package, and need to pass large (huge) double float arrays back and forth.
It looks as if base64 is the format to use, but I am too new to Perl to
figure out how to do the encoding and decoding.
If I have an array @array with thousands of double precision IEEE floats,
what is the coding sequence to get it to base64 and back???
Any help is appreciated, except RTFM, which I have already done.
------------------------------
Date: Tue, 30 Nov 2004 20:58:54 +0100
From: Matija Papec <perl@my-header.org>
Subject: Re: Passing huge double arrays in XML-RPC
Message-Id: <k8jpq094104vbgr8i8438k9s9qb9fkd4tq@4ax.com>
X-Ftn-To: zapata
"zapata" <zapata@hotmail.com> wrote:
>It looks as if base64 is the format to use, but I am too new to Perl to
>figure out how to do the encoding and decoding.
>
>If I have an array @array with thousands of double precision IEEE floats,
>what is the coding sequence to get it to base64 and back???
Did you try something already? You don't have to look at base64 for these
calls are transparent to your program.
--
Matija
------------------------------
Date: Tue, 30 Nov 2004 17:24:20 -0500
From: "zapata" <zapata@hotmail.com>
Subject: Re: Passing huge double arrays in XML-RPC
Message-Id: <coiruv$4lp$1@ngspool-d02.news.aol.com>
"Matija Papec" <perl@my-header.org> wrote in message
news:k8jpq094104vbgr8i8438k9s9qb9fkd4tq@4ax.com...
> X-Ftn-To: zapata
>
> "zapata" <zapata@hotmail.com> wrote:
>>It looks as if base64 is the format to use, but I am too new to Perl to
>>figure out how to do the encoding and decoding.
>>
>>If I have an array @array with thousands of double precision IEEE floats,
>>what is the coding sequence to get it to base64 and back???
>
> Did you try something already? You don't have to look at base64 for these
> calls are transparent to your program.
>
>
>
> --
> Matija
Whren I pass an array with doubles, I see from my port sniffer that it is
coded in XML in long hand, i.e. the doubles are converted to ASCII strings,
and enveloped with each number getting its own wrapper.
I lose the absolute bit patterns of the doubles, and the data being passed
gets bulky.
my @zap = (1.23, 4.23, 3, 44.2e-3, -1.1);
$result = $server->call('PassArray', \@zap);
POST /Helper.rem HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Host: localhost:8000
User-Agent: libwww-perl/5.79
Content-Type: text/xml
Content-Length: 349
<?xml version="1.0"?>
<methodCall>
<methodName>PassArray</methodName>
<params>
<param><value><array><data>
<value><double>0.0517676767676768</double></value><value><double>4.23</double></value><value><i4>3</i4></value><value><double>0.0442</double></value><value><double>-1.1</double></value></data></array></value>
</param>
</params>
</methodCall>
------------------------------
Date: Tue, 30 Nov 2004 19:29:43 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl trim function
Message-Id: <x7vfbn2l08.fsf@mail.sysarch.com>
>>>>> "TvP" == Tassilo v Parseval <tassilo.von.parseval@rwth-aachen.de> writes:
>> local *_ = defined wantarray ? \(my $dummy = shift) : \$_[0] if @_ ;
TvP> Even better. Amazing how a bunch of people can occupy their minds for
TvP> several days to find the best five lines of Perl code for a given minor
TvP> problem. :-)
but untested. i wonder if the local/if will work. a known similar thing
is my/if and that works by mistake. a workaround would be to use another
?: first with @_ and $_ and always localize $_.
local *_ = @_ ? defined wantarray ? \(my $dummy = shift) : \$_[0]
: \$_ ;
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 30 Nov 2004 21:44:37 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: perl trim function
Message-Id: <slrncqpmtl.1de.tassilo.von.parseval@localhost.localdomain>
Also sprach Uri Guttman:
>>>>>> "TvP" == Tassilo v Parseval <tassilo.von.parseval@rwth-aachen.de> writes:
>
> >> local *_ = defined wantarray ? \(my $dummy = shift) : \$_[0] if @_ ;
>
> TvP> Even better. Amazing how a bunch of people can occupy their minds for
> TvP> several days to find the best five lines of Perl code for a given minor
> TvP> problem. :-)
>
> but untested. i wonder if the local/if will work. a known similar thing
> is my/if and that works by mistake. a workaround would be to use another
> ?: first with @_ and $_ and always localize $_.
>
> local *_ = @_ ? defined wantarray ? \(my $dummy = shift) : \$_[0]
> : \$_ ;
I don't think this is necessary. The problem with 'my' in a
statement-modifier stems from the fact that it's happening at
compiletime...it even happens when the modifier is false at compiletime
which is then optimized away as in
my $var if 0;
It probably works because the 'my $var' is processed before the whole
statement is optimized away. If the parser chose to reverse the order of
events for some reason, it would most likely stop working.
'local' propagates into the enclosing block at compiletime, too. But
unlike 'my', it is not used to create a new variable. So the line
local *_ = defined wantarray ? \(my $dummy = shift) : \$_[0] if @_ ;
works exactly as it should...and will continue to do so: assign to the
scalar slot of *_ after localizing it. You can scratch the whole line
and the function will continue working (only trimming $_, of course).
Quite unlike with a scratched modified 'my'. This will result in a
compiletime error.
So I think the only things that should not be subjet to statement
modifiers are things that have a visible compiletime effect. That would
be 'my', 'our' and I suspect 'use', too. As for the latter, it looks as
if perl doesn't like that at all:
use CGI if 0;
syntax error at - line 1, near "use CGI if"
Execution of - aborted due to compilation errors.
I wouldn't suggest any such practice, but I think it should at least get
past the parsing stage. IMHO, this could even be called a bug.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Tue, 30 Nov 2004 20:49:09 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl trim function
Message-Id: <x74qj72hbu.fsf@mail.sysarch.com>
>>>>> "TvP" == Tassilo v Parseval <tassilo.von.parseval@rwth-aachen.de> writes:
>> local *_ = @_ ? defined wantarray ? \(my $dummy = shift) : \$_[0]
>> : \$_ ;
TvP> I don't think this is necessary. The problem with 'my' in a
TvP> statement-modifier stems from the fact that it's happening at
TvP> compiletime...it even happens when the modifier is false at compiletime
TvP> which is then optimized away as in
as i said, untested :)
yeah, i can see local as being runtime so it isn't the same as my/if.
TvP> use CGI if 0;
TvP> syntax error at - line 1, near "use CGI if"
TvP> Execution of - aborted due to compilation errors.
there is a newish 'if' pragma that does that and i think it is core
now.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Tue, 30 Nov 2004 15:19:35 -0500
From: "Martijn Stam" <spam.me@offizi.nl>
Subject: smtpprox and postfix
Message-Id: <coikkp$1i6$1@news.cistron.nl>
Hello,
I need to replace our domain name amstec.net for a couple of domain names in
the e-mail headers.
I use smtpprox as transparent proxy now, but I'm not able to modify the
script to do a find and replace.
What it has to do:
1. Find the domain name part of the To address in the e-mail headers.
2. Split the domain name on domain and extension
3. Read the content of a text file or preferable a MySQL database and if the
domain name from the To address is in the file/database then replace all
instances of amstec.net with the domain name.
Some code snippets:
while (1) {
$server->accept(%opts);
my $client = MSDW::SMTP::Client->new(interface => $dstaddr, port =>
$dstport);
my $banner = $client->hear;
$banner = "220 $debugtrace.$$" if defined $debugtrace;
$server->ok($banner);
while (my $what = $server->chat) {
if ($what eq '.') {
spew ( $client, *PREPEND ) if defined($prependheader);
#spew ( $client );
$client->yammer($server->{data});
} else {
$client->say($what);
}
$server->ok($client->hear);
}
$client = undef;
delete $server->{"s"};
exit 0 if $lives-- <= 0;
}
sub spew
{
my ($client, $fh ) = @_;
seek( $fh, 0, 0);
local( *_ );
local( $/ ) = "\r\n";
while ( <$fh> )
{
s/[\r\n]*$//;
$client->say($_);
}
}
This example adds extra headers read from an external file. It needs to be
modified to do a find and replace.
Martijn Stam
------------------------------
Date: Tue, 30 Nov 2004 16:05:24 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <reWdnVC5t8ULfTHcRVn-pQ@adelphia.com>
Alex Hunsley wrote:
> I don't suppose you know of a simple-to-get-working module that would
> fulfill my wildest SQL server connection dreams?
You might want to try DBD::mysqlPP. Instead of linking against the C
client library, it implements the network protocol used to connect to
MySQL in pure Perl.
Oh, and *do* read the docs, especially if you're in a hurry. Where on
earth did you get the silly idea that reading the docs would take longer
than asking questions here???
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 30 Nov 2004 16:08:27 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <VvKdnWrnfpvRfDHcRVn-2g@adelphia.com>
daniel kaplan wrote:
> forgive my naiveness but i thought DBI comes standard with Perl
You thought wrong. As usual.
I've explained to you before while DBD is included with ActiveState's
Perl, it's packaged as a separate PPD within their distribution because
it's not a core Perl module. But you didn't listen. As usual.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 30 Nov 2004 16:34:48 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <1101850590.975182@nntp.acecape.com>
"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:VvKdnWrnfpvRfDHcRVn-2g@adelphia.com...
> daniel kaplan wrote:
>
> > forgive my naiveness but i thought DBI comes standard with Perl
>
> You thought wrong. As usual.
>
> I've explained to you before while DBD is included with ActiveState's
> Perl, it's packaged as a separate PPD within their distribution because
> it's not a core Perl module. But you didn't listen. As usual.
it's funny shermy...sounds more like you just had to take a swipe at me
because you had an openning....would love to find where you told me about
DBD, since i could have sworn that while i did ask questions about the
arrays as a result of doign a DBI call to mysql, i never asked about getting
the DBI module....granted, i asked a lot of questions in the begingmg but
would swear not WHERE DO I GET DBI? woudl love to see that post where YOU
told me....heck, woudl love to see the one where i asked even!
the only thing that pisses me off about your little swipe, is not the swipe
itself, but how it got through to me, i 've been having your posts deleted
before i see them....no good outlook, no good shermy....dang
swipe back quickly, as i will make sure i have the problem fixed before your
next rant...but feel free to EMAIL me your response since you do have
that...
bu-bye
------------------------------
Date: Tue, 30 Nov 2004 16:58:59 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <4Yadnf0rLsO4cDHcRVn-pg@adelphia.com>
daniel kaplan wrote:
> it's funny shermy...sounds more like you just had to take a swipe at me
> because you had an openning.
It ain't personal, it's just programming. Stop posting nonsense, and
I'll stop correcting it. It's admirable that you want to help, but
misinformation doesn't help anyone.
> would love to find where you told me about DBD
<http://tinyurl.com/6fhks>
<http://groups.google.com/groups?q=+active+OR+state+OR+ppd+group:comp.lang.perl.misc+author:sherm+author:pendley&hl=en&lr=&c2coff=1&safe=off&selm=ZKednSRVefMduufcRVn-tg%40adelphia.com&rnum=1>
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 30 Nov 2004 12:32:26 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: System command
Message-Id: <301120041232269680%jgibson@mail.arc.nasa.gov>
In article <d2%qd.65$FD1.63@newsfe6-win.ntli.net>, Leon
<eon@hotmail.com> wrote:
> "Varun Jindal" <varunjindal@yahoo.com> wrote in message
> news:1101810600.015345.187340@z14g2000cwz.googlegroups.com...
> > hello,
> >
> > i am using a unix shell command within my perl script using system
> > command.
> >
> > lets say, i want to know what is hte system time (it is just an
> > example).
> >
> > so i use the system command, but i want to put the output of the
> > command in a variable in the perl script.
> > how do i do it.
> >
> > thanks in advance,
> >
> > --Varun.
> >
> @Result = `date`;
Why the array? On my system, `date` returns only one line, and I would
do:
my $date = `date`;
I realize this is just an example of system and one would normally use
the time() function, but let's give good examples. Here is one for a
system command returning multiple lines:
my @files = `ls`;
------------------------------
Date: Tue, 30 Nov 2004 22:25:47 GMT
From: "Leon" <eon@hotmail.com>
Subject: Re: System command
Message-Id: <Lr6rd.551$Z_1.86@newsfe3-gui.ntli.net>
"Jim Gibson" <jgibson@mail.arc.nasa.gov> wrote in message
news:301120041232269680%jgibson@mail.arc.nasa.gov...
> In article <d2%qd.65$FD1.63@newsfe6-win.ntli.net>, Leon
> <eon@hotmail.com> wrote:
>
> > "Varun Jindal" <varunjindal@yahoo.com> wrote in message
> > news:1101810600.015345.187340@z14g2000cwz.googlegroups.com...
> > > hello,
> > >
> > > i am using a unix shell command within my perl script using system
> > > command.
> > >
> > > lets say, i want to know what is hte system time (it is just an
> > > example).
> > >
> > > so i use the system command, but i want to put the output of the
> > > command in a variable in the perl script.
> > > how do i do it.
> > >
> > > thanks in advance,
> > >
> > > --Varun.
> > >
> > @Result = `date`;
>
> Why the array? On my system, `date` returns only one line, and I would
> do:
Sorry, my mistake, just in habit of using it with system commands that
return more than one line of text as result (can't quite explain why I then
decide to choose `date` in the example:s).
So should obviously be $Result or @Result depending on expected output:)
>
> my $date = `date`;
>
> I realize this is just an example of system and one would normally use
> the time() function, but let's give good examples. Here is one for a
> system command returning multiple lines:
>
> my @files = `ls`;
------------------------------
Date: Tue, 30 Nov 2004 22:15:34 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Transiting from Perl: Learn Python or Ruby?
Message-Id: <41acf107$0$19162$cc9e4d1f@news-text.dial.pipex.com>
Ben Morrow wrote:
> Here, though, I must disagree. I believe it is commonly accepted that
> for serious OO stuff perl5 is not really good enough. Hence the emphasis
> on it in perl6.
Defined "serious OO" stuff. The object should be to write good code in
a productive manner. Provided you have a decent API then how it is
implemented shouldn't matter. Unfortunately, many APIs don't allow for
future additions - indeed several OO proponents I've met say that it
shouldn't - apparently you're supposed to write a completeley new Object...
So, to me "serious OO" really can be serious - as in "serious mistake".
Note, this reply is nothing to do with Perl, Python, Ruby, (C, FORTRAN...).
--
-*- Just because I've written it here doesn't -*-
-*- mean that you should, or I do, believe it. -*-
------------------------------
Date: Tue, 30 Nov 2004 17:39:55 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Transiting from Perl: Learn Python or Ruby?
Message-Id: <mN6dnWx4ndAgazHcRVn-jA@adelphia.com>
Ben Morrow wrote:
> Here, though, I must disagree. I believe it is commonly accepted that
> for serious OO stuff perl5 is not really good enough.
That might be commonly accepted among Java or Smalltalk enthusiasts, but
people write "serious OO" in Perl every day. I know I do.
For example, it's true that Perl doesn't *force* you to respect strict
encapsulation in your code. But the real question is, why should it?
Can't a good programmer respect encapsulation on his own, without being
forced to do so by language restrictions?
Having said that, there's no way I'd use Perl to *teach* OO concepts.
Beginners generally do need a stricter language that enforces good
practices, at least until they have enough experience to do so on their own.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 30 Nov 2004 14:39:49 -0500
From: Patrick <psmith@marine.usf.edu>
Subject: Trying to understand Perl
Message-Id: <coihi3$p2t$1@news1.usf.edu>
Hello good people,
I am trying to understand Perl and why things work. Could someone break
down for me the snippet of code below and tell me exactly how the
operation works. I guess I am mostly confused about the placement/order
of elements of the code and how Perl interprets it. Oh and exactly how
does $_ work. I think if I could get a better understanding of the how
and why it might clear up my confusion. Thanks, Patrick
(grep {$newfile eq $_} @files)
--
Patrick A. Smith Web Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocg6.marine.usf.edu Phone: 727 553-3334
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
------------------------------
Date: Tue, 30 Nov 2004 19:51:18 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Trying to understand Perl
Message-Id: <Wa4rd.1965$zK1.85@trndny05>
"Patrick" <psmith@marine.usf.edu> wrote in message
news:coihi3$p2t$1@news1.usf.edu...
> I am trying to understand Perl and why things work. Could someone
break
> down for me the snippet of code below and tell me exactly how the
> operation works. I guess I am mostly confused about the
placement/order
> of elements of the code and how Perl interprets it. Oh and exactly how
> does $_ work. I think if I could get a better understanding of the how
> and why it might clear up my confusion. Thanks, Patrick
>
> (grep {$newfile eq $_} @files)
The C<grep> function takes two arguments. The first is a block or
expression that returns a boolean value. The second is a list of
elements. In this case, the first argument is the block
{ $newfile eq $_ }
and the second argument is the list of elements contained in
@files
The function goes through every element in the list, one at a time. On
each iteration, it assigns the current element of @files to the special
variable $_. It then executes the block. If the block returns a true
value, the current element of the list is added to the resulting list.
When the operation completes, the function will have returned a list of
all items from the original list for which the block returned a true
value.
An example:
@odds = grep { $_ % 2 == 1 } (1..10);
This statement will take each number 1 through 10, and assign it to $_.
It then executes the statement $_ % 2 == 1. If this statement is true
for the current element, that number is added to @odds.
The grep function can usually be written more expansively as a foreach
loop:
my @odds;
foreach (1..10){ #go through the list, assigning each one to $_
if ($_ % 2 == 1) { #make the comparison
push @odds, $_; # if true, add the current element to the result
}
}
I hope this explanation helps you,
Paul Lalli
------------------------------
Date: Tue, 30 Nov 2004 22:52:40 GMT
From: "Tiro Verus" <tiroverus@yahoo.com>
Subject: Re: Trying to understand Perl
Message-Id: <YQ6rd.11555$Ae.3247@newsread1.dllstx09.us.to.verio.net>
Patrick <psmith@marine.usf.edu> wrote:
> Hello good people,
> I am trying to understand Perl and why things work. Could someone break
> down for me the snippet of code below and tell me exactly how the
> operation works. I guess I am mostly confused about the placement/order
> of elements of the code and how Perl interprets it. Oh and exactly how
> does $_ work. I think if I could get a better understanding of the how
> and why it might clear up my confusion. Thanks, Patrick
> (grep {$newfile eq $_} @files)
for $_ , read perldoc perlvar
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7467
***************************************