[25235] in Perl-Users-Digest
Perl-Users Digest, Issue: 7480 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 3 14:10:39 2004
Date: Fri, 3 Dec 2004 11:10:09 -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 Fri, 3 Dec 2004 Volume: 10 Number: 7480
Today's topics:
Re: Question for Tassilo <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Re: Reference to hash and array <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Re: SQLite - problem connecting to database (or doing a <cwilbur@mithril.chromatico.net>
Re: SQLite - problem connecting to database (or doing a <do-not-use@invalid.net>
Re: SQLite - problem connecting to database (or doing a <nospam@nospam.com>
Re: testing for existence of an inline file with Inline (Anno Siegel)
Re: testing for existence of an inline file with Inline (Sven Wolf)
Re: vbscript or perl <jurgenex@hotmail.com>
Re: vbscript or perl <jwillmore@fastmail.us>
Re: vbscript or perl (Robert)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 3 Dec 2004 12:29:13 +0000 (UTC)
From: KKramsch <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Subject: Re: Question for Tassilo
Message-Id: <copm6p$6io$1@reader1.panix.com>
In <slrncr07lf.ra.tassilo.von.parseval@localhost.localdomain> "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de> writes:
>Also sprach kj:
>> Tassilo, care to elaborate on what these inconsistencies and flaws
>> are? (Or could you point me to where I can read about them?)
>I've been unable to find this specific article I had in mind...
< snip >
Many thanks!
kj
--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
------------------------------
Date: Fri, 3 Dec 2004 12:21:40 +0000 (UTC)
From: KKramsch <karlUNDERSCOREkramsch@yahooPERIODcom.invalid>
Subject: Re: Reference to hash and array
Message-Id: <coplok$6dt$1@reader1.panix.com>
In <20041203133220.44ab1f64.corleone@godfather.com> Vito Corleone <corleone@godfather.com> writes:
>Ok, I got it now. Thanks Karl :)
Actually, I spotted a bug. See below.
>On Thu, 2 Dec 2004 16:44:11 +0000 (UTC)
>KKramsch <karlUNDERSCOREkramsch@yahooPERIODcom.invalid> wrote:
>> In <20041202223711.70c830f3.corleone@godfather.com> Vito Corleone <corleone@godfather.com> writes:
>>
>> >Hi,
>> >I downloaded a module that need me to input the value in very confusing
>> >way. For example:
>> >$m = Module::->new(
>> > { 'servers' => [ "192.168.1.0:5500", "192.168.1.1:5500" ],
>> > 'debug' => 0 } );
>>
>> >You put the list of your servers IP and port number into servers. I put
>> >my servers list in config file. It looks like this:
>> >use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500';
>>
>> >And then when I load the module, I do:
>> >my @servers = split(" ", SERVERS);
>> >$m = Module::->new(
>> > { 'servers' => \@servers,
>> > 'debug' => 0 } );
>>
>> >So far so good. But you can also load the module this way.
>> >$m = Module::->new(
>> > { 'servers' => [ "192.168.1.0:5500", ["192.168.1.1:5500", 3] ],
>> > 'debug' => 0 } );
>>
>> >Besides IP and port number, it also takes the value of the server (ie:
>> >3). I want to make my config file looks like:
>> >use constant SERVERS => '192.168.1.0:5500 192.168.1.1:5500,3';
>>
>> >But I don't know how can I pass these values to the module. Or is there
>> >any better way to keep these values in config file? Please help, and
>> >thanks in advance.
>>
>> What Anno posted is right, I'm sure, but the code below may be
>> easier to follow.
>>
>> # untested
>> my @servers;
>> for my $info (split ' ', SERVERS) {
>> # $info is either of the form ip:port" or "ip:port,num"
>> my ($ip_port, $num) = split /,/, $info;
>> if ($num) {
^^^^^^^^^
That last line should be
if (defined $num) {
Otherwise you'd get incorrect results if $num happened to be 0
(assuming that such value makes sense).
Karl
>> # $info is of the form "ip:port,num"
>> push @servers, [$ip_port, $num];
>> }
>> else {
>> # info is of the form "ip:port"
>> push @servers, $info;
>> }
>> }
>>
>> my $m = Module::->new( { 'servers' => \@servers,
>> 'debug' => 0 } );
>>
>> __END__
>>
>> Makes sense?
>>
>> Karl
>>
>> --
>> Sent from a spam-bucket account; I check it once in a blue moon. If
>> you still want to e-mail me, cut out the extension from my address,
>> and make the obvious substitutions on what's left.
--
Sent from a spam-bucket account; I check it once in a blue moon. If
you still want to e-mail me, cut out the extension from my address,
and make the obvious substitutions on what's left.
------------------------------
Date: Fri, 03 Dec 2004 16:24:14 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <87mzwww5p3.fsf@mithril.chromatico.net>
>>>>> "fuckwit" == daniel kaplan <nospam@nospam.com> writes:
fuckwit> i stand by what i have said before, some people here are
fuckwit> upset with me cause i won't take their casual insults
fuckwit> sitting down.
No, some people are upset with you because you are incapable of doing
even basic research on your own and because you are incapable of
making a post to Usenet without at least one significant technical
error or personal attack in it.
If you wish to prove me wrong, start posting questions that aren't
FAQs (and that haven't already been answered for you), posts
containing correct technical information, and posts without personal
attacks.
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: 03 Dec 2004 18:51:45 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <yzdeki7mfri.fsf@invalid.net>
Charlton Wilbur <cwilbur@mithril.chromatico.net> writes:
> >>>>> "fuckwit" == daniel kaplan <nospam@nospam.com> writes:
>
> fuckwit> i stand by what i have said before, some people here are
> fuckwit> upset with me cause i won't take their casual insults
> fuckwit> sitting down.
>
> No, some people are upset with you because you are incapable of doing
> even basic research on your own and because you are incapable of
> making a post to Usenet without at least one significant technical
> error or personal attack in it.
>
> If you wish to prove me wrong, start posting questions that aren't
> FAQs (and that haven't already been answered for you), posts
> containing correct technical information, and posts without personal
> attacks.
I seem to find a fair number of those with dejanews.
------------------------------
Date: Fri, 3 Dec 2004 13:04:37 -0500
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: SQLite - problem connecting to database (or doing a select)
Message-Id: <1102099991.693582@nntp.acecape.com>
"Arndt Jonasson" <do-not-use@invalid.net> wrote in message
news:yzdeki7mfri.fsf@invalid.net...
> I seem to find a fair number of those with dejanews.
am sure i am not the first, nor the last......and i am sure i will do it
again myself, it's just happens....but i like the name....and will try not
to do it again
as for whatever wilbur said (i noticed him in your reply) not a clue....he's
in my killfile group (which i am sure suits him just fine)....seems there's
more than enough people here who don't mind just answering without the
snottyness..."oh wilbur....."
------------------------------
Date: 3 Dec 2004 13:03:47 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: testing for existence of an inline file with Inline::Files
Message-Id: <copo7j$6o5$2@mamenchi.zrz.TU-Berlin.DE>
Tad McClellan <tadmc@augustmail.com> wrote in comp.lang.perl.misc:
> Sven Wolf <swolf2@yahoo.com> wrote:
> > Hello,
> >
> > I'm using Inline::Files, which allows me to put data after __FOO__ in
> > a file and then to read it with "while (<FOO>) {...}" or @lines =
> ><FOO>;
>
>
> > I get a read-from-unopened-filehandle error if there is no section
> > __MYCANDIDATE__ in the script.
> >
> > Can someone suggest a test to apply before attempting to read?
>
>
> The docs say that a package variable named $MYCANDIDATE will
> exist if there is such a section. You can just look in the
> symbol table to see if one by that name is there or not.
>
> This seems to work for me:
>
> die 'no such section' unless exists $main::{MYCANDIDATE};
More generally, fileno( HANDLE) will be defined if and only of HANDLE
is an open filehandle. In particular,
defined fileno( DATA)
will tell if there is an available __DATA__ or __END__ section. I
suppose that's how $MYCANDIDATE is set internally.
Anno
------------------------------
Date: 3 Dec 2004 10:21:12 -0800
From: swolf2@yahoo.com (Sven Wolf)
Subject: Re: testing for existence of an inline file with Inline::Files
Message-Id: <919461e0.0412031021.cde8ef6@posting.google.com>
Tad McClellan <tadmc@augustmail.com> wrote in message news:<slrncqvv0r.cmo.tadmc@magna.augustmail.com>...
> Sven Wolf <swolf2@yahoo.com> wrote:
> > Hello,
> >
> > I'm using Inline::Files, which allows me to put data after __FOO__ in
> > a file and then to read it with "while (<FOO>) {...}" or @lines =
> ><FOO>;
>
>
> > I get a read-from-unopened-filehandle error if there is no section
> > __MYCANDIDATE__ in the script.
> >
> > Can someone suggest a test to apply before attempting to read?
>
>
> The docs say that a package variable named $MYCANDIDATE will
> exist if there is such a section. You can just look in the
> symbol table to see if one by that name is there or not.
>
> This seems to work for me:
>
> die 'no such section' unless exists $main::{MYCANDIDATE};
Yes, that works for me, too. The trick is making it work indirectly.
I have $inlinefile = 'MYCANDIDATE'. Is there an expression in terms
of the lhs?
------------------------------
Date: Fri, 03 Dec 2004 15:19:59 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: vbscript or perl
Message-Id: <zu%rd.178$S33.133@trnddc03>
David wrote:
> I have to port a moderately complicated unix shell script written for
> Solaris to Windows. I've never done Windows scripting before.
> Should I
>
> (a) learn VBScript and implement it in that;
> (b) install Active Perl on the target Windows box and rewrite the
> script in perl (which I am familiar with).
You are kind of comparing model cars and real airplanes. To me that doesn't
make much sense.
I hope you are aware that VB Script is a client-side scripting language
which is executed as part of DHTML in a particular web browser while Perl is
general purpose programming language and has nothing to do with DHTML (you
need PerlScript for that)?
jue
------------------------------
Date: Fri, 03 Dec 2004 10:39:08 -0500
From: James Willmore <jwillmore@fastmail.us>
Subject: Re: vbscript or perl
Message-Id: <pan.2004.12.03.15.39.08.649774@fastmail.us>
On Fri, 03 Dec 2004 18:52:16 +1100, David wrote:
> I have to port a moderately complicated unix shell script written for
> Solaris to Windows. I've never done Windows scripting before. Should I
>
> (a) learn VBScript and implement it in that;
> (b) install Active Perl on the target Windows box and rewrite the script in
> perl (which I am familiar with).
>
> The script in question most does database stuff e.g. calls stored procs,
> parses text files then loads new records with bcp.
The real question is .... which do you know better. If you can honestly
answer that question, then you'll already have an answer :-)
HTH
Jim
------------------------------
Date: 3 Dec 2004 07:44:32 -0800
From: sigzero@gmail.com (Robert)
Subject: Re: vbscript or perl
Message-Id: <5b49f5aa.0412030744.776a8efb@posting.google.com>
Alan Mead <amead@comcast.net> wrote in message news:<pan.2004.12.03.08.14.18.915022@comcast.net>...
> On Fri, 03 Dec 2004 18:52:16 +1100, David wrote:
>
> > I have to port a moderately complicated unix shell script written for
> > Solaris to Windows. I've never done Windows scripting before. Should I
> >
> > (a) learn VBScript and implement it in that;
> > (b) install Active Perl on the target Windows box and rewrite the script in
> > perl (which I am familiar with).
> >
> > The script in question most does database stuff e.g. calls stored procs,
> > parses text files then loads new records with bcp.
>
> David,
>
> I think clearly vbscript would be the way to go. Microsoft has spent a
> lot of money on research that shows that all their products beat
> everything else. Besides, who's ever heard of someone using Perl for
> goofy stuff like processing text or accessing databases!? I don't think
> it does that...
>
> It's really a no-brainer. I'm kind of embarassed that you asked at all.
>
> Have fun learning vbscript.
>
> -Alan
SARCASM ALERT!!!!
:-)
Robert
------------------------------
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 7480
***************************************