[17185] in Perl-Users-Digest
Perl-Users Digest, Issue: 4597 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 12 14:10:32 2000
Date: Thu, 12 Oct 2000 11:10:18 -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: <971374218-v9-i4597@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 12 Oct 2000 Volume: 9 Number: 4597
Today's topics:
Japanese Girl Has PERL Request. <kaori@japanesegirl.com>
Re: Japanese Girl Has PERL Request. <anmcguire@ce.mediaone.net>
Re: Japanese Girl Has PERL Request. <anders@wall.alweb.dk>
Re: Japanese Girl Has PERL Request. <jeff@vpservices.com>
Re: Japanese Girl Has PERL Request. <anders@wall.alweb.dk>
Re: Japanese Girl Has PERL Request. (brian d foy)
Re: K-Shell to PERL converter (Randal L. Schwartz)
Re: looking for links to Perl+mysql how-to's - tutorial (Jon S.)
Re: modifying elements in an each() loop (Garry Williams)
Odd number of elements in hash list ... huh? <glenn_tillema@adc.com>
Re: Odd number of elements in hash list ... huh? (Rafael Garcia-Suarez)
Re: Odd number of elements in hash list ... huh? (John J. Trammell)
Re: Odd number of elements in hash list ... huh? (Clay Irving)
Re: Odd number of elements in hash list ... huh? <anmcguire@ce.mediaone.net>
Re: Odd number of elements in hash list ... huh? <glenn_tillema@adc.com>
Re: Odd number of elements in hash list ... huh? <glenn_tillema@adc.com>
Re: Odd number of elements in hash list ... huh? <dave@dave.org.uk>
Re: Odd number of elements in hash list ... huh? (John J. Trammell)
Re: Odd number of elements in hash list ... huh? <glenn_tillema@adc.com>
Re: Odd number of elements in hash list ... huh? nobull@mail.com
Perl and Filemaker <amanoj@cs.wisc.edu>
Re: Perl and Filemaker (brian d foy)
Re: Perl and Filemaker <jeff@vpservices.com>
Re: Perl and Filemaker <dwilgaREMOVE@mtholyoke.edu>
Re: perl, decimal <aakbari@crosskeys.com>
Pool Ladder CGI <jmilley@tera.engr.mun.ca>
Re: splitting an array into a hash of sub-arrays <already_seen@my-deja.com>
Re: Very Newbie Question - Form output to file vs mail nobull@mail.com
Re: Weekday at a date (John J. Trammell)
Re: Weekday at a date <soeder@ai-lab.fh-furtwangen.de>
Re: Weekday at a date <sb@muccpu1.muc.sdm.de>
Re: will perl 5 work w/o server on my PC <camerond@mail.uca.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 12 Oct 2000 15:52:11 GMT
From: "Kaori Ayn Honeywell" <kaori@japanesegirl.com>
Subject: Japanese Girl Has PERL Request.
Message-Id: <L6lF5.4021$Q15.50241948@news2.news.adelphia.net>
I am trying to create a simple database of
information collected from an online form that
was created in FrontPage.
Can someone please send me the PERL code
that I need to interface the form with the Access
database to make this work?
Please also include the simple step by step
instructions that I need to follow.
Thank you very much or your time and attention.
Kaori Ayn Honeywell
kaori@JapaneseGirl.com
------------------------------
Date: Thu, 12 Oct 2000 11:17:18 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <Pine.LNX.4.21.0010121115590.19951-100000@hawk.ce.mediaone.net>
On Thu, 12 Oct 2000, Kaori Ayn Honeywell quoth:
KAH> I am trying to create a simple database of
KAH> information collected from an online form that
KAH> was created in FrontPage.
KAH>
KAH> Can someone please send me the PERL code
KAH> that I need to interface the form with the Access
KAH> database to make this work?
KAH>
KAH> Please also include the simple step by step
KAH> instructions that I need to follow.
KAH>
KAH> Thank you very much or your time and attention.
So you want us to provide programs and documentation for your porn
site? I don't think so.
*plonk*
anm
--
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew N. McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'
------------------------------
Date: Thu, 12 Oct 2000 18:33:18 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <7KlF5.11519$u23.305037@news000.worldonline.dk>
Andrew N. McGuire wrote:
>
> So you want us to provide programs and documentation for your porn
> site? I don't think so.
>
> *plonk*
>
> anm
Nothing indicates that the young lady is in the buissness you mention
Andew, apart from beeing somewhat naive and guilty of not having done
research on this list she did nothing wrong.
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Thu, 12 Oct 2000 09:40:26 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <39E5E97A.EE7CF250@vpservices.com>
Anders Lund wrote:
>
> Andrew N. McGuire wrote:
>
> >
> > So you want us to provide programs and documentation for your porn
> > site? I don't think so.
> >
> > *plonk*
> >
> > anm
>
> Nothing indicates that the young lady is in the buissness you mention
> Andew
You are mistaken Anders. You omitted the part of JG's post that
confirms that Andrew is correct:
http://www.JapaneseGirl.com/
*plonk* (JG, not Anders)
--
Jeff
------------------------------
Date: Thu, 12 Oct 2000 18:45:38 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <IVlF5.11842$UW.326065@news010.worldonline.dk>
Jeff Zucker wrote:
>
> Anders Lund wrote:
> >
> > Andrew N. McGuire wrote:
> >
> > >
> > > So you want us to provide programs and documentation for your porn
> > > site? I don't think so.
> > >
> > > *plonk*
> > >
> > > anm
> >
> > Nothing indicates that the young lady is in the buissness you mention
> > Andew
>
> You are mistaken Anders. You omitted the part of JG's post that
> confirms that Andrew is correct:
>
> http://www.JapaneseGirl.com/
>
> *plonk* (JG, not Anders)
>
Ooops
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Thu, 12 Oct 2000 13:18:43 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Japanese Girl Has PERL Request.
Message-Id: <brian-ya02408000R1210001318430001@news.panix.com>
In article <Pine.LNX.4.21.0010121115590.19951-100000@hawk.ce.mediaone.net>, "Andrew N. McGuire " <anmcguire@ce.mediaone.net> posted:
> On Thu, 12 Oct 2000, Kaori Ayn Honeywell quoth:
> KAH> Can someone please send me the PERL code
> KAH> that I need to interface the form with the Access
> KAH> database to make this work?
> So you want us to provide programs and documentation for your porn
> site? I don't think so.
you should thank porn site operators. they are the ones that
push the technology. seriously. you should see some of the
network setups the big sites have. they push a serious amount
of bits.
however, there is no reason why anyone should be locked out of
using Perl, unless you think freedom (whether libre or no-cost)
is something reserved for linux weenies.
[ gees, after Perl Mongers maybe i should start the PCLU ;) ]
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: 12 Oct 2000 08:15:03 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: K-Shell to PERL converter
Message-Id: <m1itqyf5vs.fsf@halfdome.holdit.com>
>>>>> "nandagopalj" == nandagopalj <nandagopalj@hotmail.com> writes:
nandagopalj> Hello:
nandagopalj> Does anyone know of a freeware to convert k-shell
nandagopalj> scripts into PERL?
nandagopalj> Your help is appreciated.
About the best you're gonna do is at
http://www.cpan.org/authors/id/MERLYN/sh2perl-0.03.tar.gz
Beware - the original release date was April 1st. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 12 Oct 2000 16:46:32 GMT
From: jonceramic@nospammiesno.earthlink.net (Jon S.)
Subject: Re: looking for links to Perl+mysql how-to's - tutorials etc
Message-Id: <39e5ead5.13270040@news.earthlink.net>
On Sat, 7 Oct 2000 12:00:59 +1000, "Robert Chalmers"
<robert@chalmers.com.au> wrote:
>Looking for links to sites with howto's - tutorials - examples - code
>examples and so on.
>
>Does anyone know of a couple of good ones they can recommend. I know - I
>could spend hours searching but maybe someone can offer a short cut.
I'm just a newbie, but...
I mainly found links for PHP and MySQL. My standard places _online_
are the OReilly online chapter for the mSQL/MySQL book, the DBI/DBD
docs, and www.mysql.com. You can also try slashcode.com for many
examples. But, they're hard to grok if you're new at it, and not
necessarily the best form, etc. by nature.
But, the best tutorial I've found was "Programming the Perl DBI" from
OReilly. A great book for the beginner who knows a little (or a lot?)
of Perl already.
Jon
------------------------------
Date: Thu, 12 Oct 2000 16:04:54 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: modifying elements in an each() loop
Message-Id: <GilF5.189$XQ2.7921@eagle.america.net>
On 12 Oct 2000 14:06:21 GMT, M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
>John Salmon <jsalmon@thesalmons.org> wrote:
>>
>>man perlfunc says:
>>
>> each HASH
>> <snip>
>> If
>> you add or delete elements of a hash while you're
>> iterating over it, you may get entries skipped or
>> duplicated, so don't.
>
>"add or delete elements of a hash" would perhaps be more precisely worded
>as "add to or delete from the set of keys in the hash". Changing
>the value associated with a given key doesn't count.
It may also interest you to know that I discovered that even an update
of an existing element inside a loop over each() could result in
unpredictable results when the hash was tied to NDBM_File. If memory
serves, this was with perl 5.004_04 and Solaris 2.5.1 or Solaris 2.6.
--
Garry Williams
------------------------------
Date: Thu, 12 Oct 2000 09:22:53 -0500
From: Glenn Tillema <glenn_tillema@adc.com>
Subject: Odd number of elements in hash list ... huh?
Message-Id: <39E5C93D.5040109@adc.com>
I've been trying to fix a rather large script and have run into a big
problem - "Odd number of elements in hash list".
-----
1: #!/usr/local/bin/perl -w
...
2: %attr={PrintError=>0, RaiseError=>1};
3: eval {
4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
...
-----
If I change the '{' to '(' the script fails on line 4, demanding \%attr
instead of %attr. What am I doing wrong?
Glenn
------------------------------
Date: Thu, 12 Oct 2000 15:28:01 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <slrn8ubmh4.2tn.rgarciasuarez@rafael.kazibao.net>
Glenn Tillema wrote in comp.lang.perl.misc:
>I've been trying to fix a rather large script and have run into a big
>problem - "Odd number of elements in hash list".
>
>-----
>
>1: #!/usr/local/bin/perl -w
>...
>2: %attr={PrintError=>0, RaiseError=>1};
Warning here : %attr is a hash, but {...} defines a reference to a hash.
You should write :
%attr=(PrintError=>0, RaiseError=>1);
What you've written initializes %attr to be a hash with only one key,
which is is the string representation of a hashref (something like
"HASH(0X12837643)"). The key associated to this value is undef.
>3: eval {
>4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
The DBI API requires a hashref as the optional 4th argument of connect.
\ is the reference operator : thus, \%attr is a reference to %attr.
You should write :
$idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", \%attr);
Another way is to use an hashref $attr instead of a hash %attr:
$attr={PrintError=>0, RaiseError=>1};
...
$idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", $attr);
See the perlref manpage for more info.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 12 Oct 2000 15:35:00 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <slrn8uasac.2ul.trammell@nitz.hep.umn.edu>
On Thu, 12 Oct 2000 09:22:53 -0500, Glenn Tillema <glenn_tillema@adc.com>
wrote:
>I've been trying to fix a rather large script and have run into a big
>problem - "Odd number of elements in hash list".
>
>1: #!/usr/local/bin/perl -w
1.5: use strict; # :-)
>2: %attr={PrintError=>0, RaiseError=>1};
2: my %attr = ( PrintError => 0, RaiseError => 1 );
>4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","foo","bar",\%attr);
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: 12 Oct 2000 15:37:15 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <slrn8ubmlb.5d6.clay@panix3.panix.com>
On Thu, 12 Oct 2000 09:22:53 -0500, Glenn Tillema <glenn_tillema@adc.com> wrote:
>I've been trying to fix a rather large script and have run into a big
>problem - "Odd number of elements in hash list".
Really? What do you consider an odd number? :)
>-----
>
>1: #!/usr/local/bin/perl -w
>...
>2: %attr={PrintError=>0, RaiseError=>1};
>3: eval {
>4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
>
>...
>
>-----
>
>If I change the '{' to '(' the script fails on line 4, demanding \%attr
>instead of %attr. What am I doing wrong?
Why not this?
my %attr = (
PrintError => 0,
RaiseError => 1
);
my $dbh = DBI->connect(("dbi:Oracle:DBSERVER","blah","blahblah", \%attr);
--
Clay Irving <clay@panix.com>
But I don't have an any key on my computer!
------------------------------
Date: Thu, 12 Oct 2000 11:00:46 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <Pine.LNX.4.21.0010121058390.19951-100000@hawk.ce.mediaone.net>
On Thu, 12 Oct 2000, Glenn Tillema quoth:
GT> I've been trying to fix a rather large script and have run into a big
GT> problem - "Odd number of elements in hash list".
GT>
GT> -----
GT>
GT> 1: #!/usr/local/bin/perl -w
GT> ...
GT> 2: %attr={PrintError=>0, RaiseError=>1};
GT> 3: eval {
GT> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
GT>
GT> ...
GT>
GT> -----
GT>
GT> If I change the '{' to '(' the script fails on line 4, demanding \%attr
GT> instead of %attr. What am I doing wrong?
My guess (I have not much experience with the DBI module) is that connect
is looking for a hashref, so change the {} to () and the % in connect()
to \%, and see if that works. If that makes any sense.
perldoc perlref
HTH.
anm
--
perl -lwMstrict -e ' # Jim Menard -> Wyzelli -> Andrew McGuire
for$;(reverse++$|..100){$:=$;==$|?q++:"s";$@="bottle";$_=(q\e\x2)."l"x2**1
;m?(..)$?,;$$=" on";print$;=>v32,"$@$:".v32,"of b$`r".$$." th$`\b wa$1,"=>
v10."$; $@$: of b$`r,\012tak$`\b$$"."e down, pass it around,",q&&;$;--;$:=
$;==$|?$!:q-s-=>;print"$; $@$:$$\bf b$`r",$$." the wa$1\n"}print q#*burp*#
'
------------------------------
Date: Thu, 12 Oct 2000 11:01:50 -0500
From: Glenn Tillema <glenn_tillema@adc.com>
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <39E5E06E.2090404@adc.com>
Rafael Garcia-Suarez wrote:
>> 1: #!/usr/local/bin/perl -w
>> ...
>> 2: %attr={PrintError=>0, RaiseError=>1};
>
>
> Warning here : %attr is a hash, but {...} defines a reference to a hash.
> You should write :
> %attr=(PrintError=>0, RaiseError=>1);
That's what I thought! I don't get the 'Odd number ...' error when I changed it but
instead I get;
Error: Usage: $class->connect([$dsn [,$user [,$passwd [,\%attr]]]])
Even though I have used %attr correctly in both creating the hash and using \%attr where
it asked for it I still get this error.
Thank you for your help, I'll see if I can't find someother way of calling the server
without having to send it the hash.
Glenn
------------------------------
Date: Thu, 12 Oct 2000 11:05:31 -0500
From: Glenn Tillema <glenn_tillema@adc.com>
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <39E5E14B.1070904@adc.com>
John J. Trammell wrote:
> On Thu, 12 Oct 2000 09:22:53 -0500, Glenn Tillema <glenn_tillema@adc.com>
> wrote:
>
>> I've been trying to fix a rather large script and have run into a big
>> problem - "Odd number of elements in hash list".
>>
>> 1: #!/usr/local/bin/perl -w
>
> 1.5: use strict; # :-)
That helps a lot with my smaller script but when I put it into the larger script it
completely falls apart. Go figure.
>> 2: %attr={PrintError=>0, RaiseError=>1};
>
> 2: my %attr = ( PrintError => 0, RaiseError => 1 );
Thats what I thought. See my next comment.
>> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
>
> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","foo","bar",\%attr);
The problem is, although fixing the hash reference removes my 'Odd number ...' error, it
creates an impassible 'Usage: $class->connect([$dsn [,$user [,$passwd [,\%attr]]]])' error
with line 4.
Thanks for your help, though!
Glenn
------------------------------
Date: Thu, 12 Oct 2000 17:44:20 +0100
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <8s4pqf$949$1@taliesin.netcom.net.uk>
Glenn Tillema <glenn_tillema@adc.com> wrote in message
news:39E5E06E.2090404@adc.com...
> Rafael Garcia-Suarez wrote:
>
> >> 1: #!/usr/local/bin/perl -w
> >> ...
> >> 2: %attr={PrintError=>0, RaiseError=>1};
> >
> >
> > Warning here : %attr is a hash, but {...} defines a reference to a hash.
> > You should write :
> > %attr=(PrintError=>0, RaiseError=>1);
>
> That's what I thought! I don't get the 'Odd number ...' error when I
changed it but
> instead I get;
>
> Error: Usage: $class->connect([$dsn [,$user [,$passwd [,\%attr]]]])
>
> Even though I have used %attr correctly in both creating the hash and
using \%attr where
> it asked for it I still get this error.
Not if you do also change the connect call to \%attr instead of just %attr.
You really should read something on Perl data structures and references.
I recommend perldoc perlreftut and perldoc perldsc
Cheers,
Dave...
------------------------------
Date: 12 Oct 2000 16:45:49 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <slrn8ub0f4.311.trammell@nitz.hep.umn.edu>
On Thu, 12 Oct 2000 11:05:31 -0500, Glenn Tillema <glenn_tillema@adc.com> wrote:
>John J. Trammell wrote:
>
[snip]
>> 1.5: use strict; # :-)
>
>That helps a lot with my smaller script but when I put it into the larger
>script it completely falls apart. Go figure.
[snip]
>> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","foo","bar",\%attr);
>The problem is, although fixing the hash reference removes my 'Odd number
>...' error, it creates an impassible 'Usage: $class->connect([$dsn [,$user
>[,$passwd [,\%attr]]]])' error with line 4.
Not to be harsh, but if you're not on top of the difference between
hashes and hash references, IMHO the best thing for you to do at this
point is to spend the energy getting your longer script compiling
under 'use strict'. You will learn a lot.
BTW, 'perldoc DBI' gives me, e.g.:
$dbh = DBI->connect($dsn, $user, $password,
{ RaiseError => 1, AutoCommit => 0 });
Best of luck.
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Thu, 12 Oct 2000 12:14:45 -0500
From: Glenn Tillema <glenn_tillema@adc.com>
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <39E5F185.9000402@adc.com>
John J. Trammell wrote:
>>> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","foo","bar",\%attr);
>>
>> The problem is, although fixing the hash reference removes my 'Odd number
>> ...' error, it creates an impassible 'Usage: $class->connect([$dsn [,$user
>> [,$passwd [,\%attr]]]])' error with line 4.
>
>
> Not to be harsh, but if you're not on top of the difference between
> hashes and hash references, IMHO the best thing for you to do at this
> point is to spend the energy getting your longer script compiling
> under 'use strict'. You will learn a lot.
Someone else wrote the script, I'm just fixing it. I don't take any of
yours or anyone else's comments harshly - I don't take criticism as insults
unless you say, "Your code is awful AND you have poor taste in beer."
I had tried setting up the hash correctly and then using the hashref
in the connect call but I still get the usage error.
I think I will go over the script and fix it in regards to use strict -
maybe something will come up. Thanks for your help!
> BTW, 'perldoc DBI' gives me, e.g.:
>
> $dbh = DBI->connect($dsn, $user, $password,
> { RaiseError => 1, AutoCommit => 0 });
Sadly, perldoc wasn't installed on these servers. I usually just hit
perl.com and do a search or rifle through the camel.
Glenn
------------------------------
Date: 12 Oct 2000 18:29:06 +0100
From: nobull@mail.com
Subject: Re: Odd number of elements in hash list ... huh?
Message-Id: <u91yxm0xzx.fsf@wcl-l.bham.ac.uk>
Glenn Tillema <glenn_tillema@adc.com> writes:
> I've been trying to fix a rather large script and have run into a big
> problem - "Odd number of elements in hash list".
> 2: %attr={PrintError=>0, RaiseError=>1};
{} creates a reference to a hash. A reference is a scalar.
> 3: eval {
> 4: $idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", %attr);
> If I change the '{' to '(' the script fails on line 4, demanding \%attr
> instead of %attr. What am I doing wrong?
Is this a trick question? You are missing the \ off of \%attr.
At a higher level what you are doing wrong is failing to realise that
if you want a variable to hold simply a reference to a hash then that
variable must itself be a scalar and not a hash.
$attr={PrintError=>0, RaiseError=>1};
$idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", $attr);
OR
%attr=(PrintError=>0, RaiseError=>1);
$idbh = DBI->connect("dbi:Oracle:DBSERVER","blah","blahblah", \%attr);
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 12 Oct 2000 10:46:34 -0500
From: Manoj Ananthapadmanabhan <amanoj@cs.wisc.edu>
Subject: Perl and Filemaker
Message-Id: <39E5DCDA.6A502ADA@cs.wisc.edu>
Hi
All our data is in Filemaker Pro database and we are planning to shift
to MySql now.
Is there any Perl module available with which I'll be able to connect to
a Filemaker Pro database.
Thanks
Manoj
------------------------------
Date: Thu, 12 Oct 2000 13:27:28 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Perl and Filemaker
Message-Id: <brian-ya02408000R1210001327280001@news.panix.com>
In article <39E5DCDA.6A502ADA@cs.wisc.edu>, Manoj Ananthapadmanabhan <amanoj@cs.wisc.edu> posted:
> All our data is in Filemaker Pro database and we are planning to shift
> to MySql now.
> Is there any Perl module available with which I'll be able to connect to
> a Filemaker Pro database.
not that i have ever found, and i never finished writing the one that
i started. i found it was a lot easier to export the FileMaker stuff
(which can be rather flexible in format) and then LOAD FROM FILE in
mysql (which can also be rather flexible).
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Thu, 12 Oct 2000 10:35:50 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Perl and Filemaker
Message-Id: <39E5F676.8606C52E@vpservices.com>
brian d foy wrote:
>
> In article <39E5DCDA.6A502ADA@cs.wisc.edu>, Manoj Ananthapadmanabhan <amanoj@cs.wisc.edu> posted:
>
> > All our data is in Filemaker Pro database and we are planning to shift
> > to MySql now.
> > Is there any Perl module available with which I'll be able to connect to
> > a Filemaker Pro database.
>
> not that i have ever found, and i never finished writing the one that
> i started. i found it was a lot easier to export the FileMaker stuff
> (which can be rather flexible in format) and then LOAD FROM FILE in
> mysql (which can also be rather flexible).
I haven't done this, but there is a FilemakerPro ODBC driver, see:
http://www.filemaker.com.au/products/odbc_backgrounder.html
So theoretically one ought to be able to run DBI with DBD::ODBC and
FilemakerPro.
--
Jeff
------------------------------
Date: Thu, 12 Oct 2000 17:40:21 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: Perl and Filemaker
Message-Id: <dwilgaREMOVE-892A6E.13403812102000@news.mtholyoke.edu>
In article <39E5DCDA.6A502ADA@cs.wisc.edu>, Manoj Ananthapadmanabhan
<amanoj@cs.wisc.edu> wrote:
> Hi
> All our data is in Filemaker Pro database and we are planning to shift
> to MySql now.
> Is there any Perl module available with which I'll be able to connect to
> a Filemaker Pro database.
DBI and DBD::ODBC may be able to do it, but I don't know which driver you
would use. If you're going to be shifting to mySQL, why not just export the
data from FM and import it into the new DB?
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: Thu, 12 Oct 2000 11:42:14 -0400
From: Afshin Akbari <aakbari@crosskeys.com>
Subject: Re: perl, decimal
Message-Id: <39E5DBD6.9623EFBA@crosskeys.com>
--------------98E4868FF72EF9E86441F7BA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
if it is to display use printf for example: %8.3 f
Here, the number preceding the decimal point is the field width
and the number after the decimal point is the number of decimal places
to print. (Almost like C, if you know C).
aa -
DT wrote:
> Hi,
>
> I want to if there is PERL command to
> - control number of decimal place
> - to trucate
>
> thanks
--------------98E4868FF72EF9E86441F7BA
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 it is to display use <b>printf </b>for example: %8.3
f
<br>Here, the number preceding the decimal point is the field width
<br>and the number after the decimal point is the number of decimal places
<br>to print. (Almost like C, if you know C).
<p>aa -
<br>
<br>
<p>DT wrote:
<blockquote TYPE=CITE>Hi,
<p>I want to if there is PERL command to
<br>- control number of decimal place
<br>- to trucate
<p>thanks</blockquote>
</html>
--------------98E4868FF72EF9E86441F7BA--
------------------------------
Date: 12 Oct 2000 16:09:58 GMT
From: Jonathan MILLEY <jmilley@tera.engr.mun.ca>
Subject: Pool Ladder CGI
Message-Id: <8s4nom$ah8$1@coranto.ucs.mun.ca>
want to run a pool ladder on my server, so that people can register, issue challanges, and report out comes, etc.
Does any one know of any scripts out there that could be modified, or should I just go ahead and build something from the ground up?
Thanks
Jon
--
=================================================================
Jonathan Milley jmilley@engr.mun.ca EE Class of 2003
Memorial University of Newfoundland
St. John's, Newfoundland, Canada
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Heghlu'meH QaQ jajvam
"Today is a good day to die"
=================================================================
------------------------------
Date: Thu, 12 Oct 2000 16:44:53 GMT
From: post_to_group <already_seen@my-deja.com>
Subject: Re: splitting an array into a hash of sub-arrays
Message-Id: <8s4pq3$mqd$1@nnrp1.deja.com>
In article <8s2k2n$ubh$1@nnrp1.deja.com>,
stdenton@my-deja.com wrote:
> This is a day late and a dollar short, but wot de heck...
It's never too late for useful info!
> Hmm, actually I was only using Data::Dumper to pretty-print the
results
> of what I was doing. The "meat" of my posting was almost exactly the
> same as Ren's.
>
> Compare my code:
> for (my $i = 0; $i < numSubsets; $i++) {
> my @s = splice(@hosts, 0, $numInEachSubset);
> $subset[$i] = \@s;
> }
>
> to Ren's code:
> push @hostgroups, [ splice(@hosts, 0, $hosts_per_group) ]
> while @hosts;
>
> We both have a loop the iterates the same number of times (mine is a
> "for" loop, Ren's is a "while" looop). We both use splice to pull a
> bunch of elements from the array at once. Ren's gets a higher golf
> score, mine (I hope!) would be simpler for a novice to understand.
>
Yep, you're right. You posted perfectly good code and I should have
looked at it more closely. And now looking at your code it definitely
is easier for a novice like me to understand. The for loop is how I had
my own/original code and so it was partially the crypticness of that
while loop that took me so long to understand Ren's code bit - how it
was that he was subdividing the sub-arrays. Things definitely look
clearer with this second look! Had Ren not posted right after you I
probably would have looked more closely and, as I did with his code bit,
played with your code until I understood it had nothing to do with the
Data::Dumper module.
Still it took me a while of trying various permutations to just
understand what you two were doing with the "array refs." Now that bit
of code is working I am still working on the fork/eval bit which I will
repost since I think my previous post was either too long or not clear
enough.
thanks again,
Adam
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 12 Oct 2000 18:28:09 +0100
From: nobull@mail.com
Subject: Re: Very Newbie Question - Form output to file vs mail
Message-Id: <u94s2i0y1i.fsf@wcl-l.bham.ac.uk>
"Bill Fulbright" <bfulb@bellsouth.net> writes:
> I am very new to Perl and CGI, altho I have used modules on various free
> wesite hosts. I am familiar with using:
>
> <FORM ACTION="/bin/script_library/form_handler_file" METHOD=POST>
>
> and
>
> <FORM ACTION="/bin/script_library/form_handler_mail" METHOD=POST>
>
> These are statements I got from Tripod's "Form Handler" script.
>
> 1. Are these standard and compatible with Perl 5?
This is HTML. Nothing to do with Perl.
/bin/script_library/form_handler_mail could be a script written in
Perl5 being called by the HTTP server using CGI API. It could
also be a program written in any other language and using any of a
fairly wide range of APIs between the HTTP server and the program.
> 2. what do I need to do to use this in my own server?
Learn about webserver configuration, HTML, CGI and at least one
programming language (Perl, for instance). Alternatively employ
someone who understands this stuff.
> I have been asked by my company to build a simple form with output to a
> file, which we will import to Access, etc.
>
> I am using Perl Builder Software with the CGI Wizard, and have looked
> through the help for how to output to file, and have not been able to find
> anything.
Fancy "builder" programs and "wizards" don't generally do a complete
job for you, you still need to fill in the spaces with real code. In
this case Perl code. There is no alternative to learning to program.
The help pages for the builder program is unlikely to cover every
detail of Perl programming as that would be pointless duplication of
documentation.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 12 Oct 2000 15:23:42 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Weekday at a date
Message-Id: <slrn8uarl6.2uf.trammell@nitz.hep.umn.edu>
On Thu, 12 Oct 2000 16:44:29 +0200, Malte Ubl <ubl@schaffhausen.de>
wrote:
[snip]
>My problem is that I need to know which day was on a particular
>date. An example problem would be to find out on which day of
>the week you were born.
>
>I basically need to implement this function:
>
>sub weekday_of_date(someDate) {
> ...
>}
One solution is:
use Date::Calc qw[ Day_of_Week ];
$dow = Day_of_Week($year,$month,$day);
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Thu, 12 Oct 2000 19:08:04 -0700
From: Oliver Soeder <soeder@ai-lab.fh-furtwangen.de>
Subject: Re: Weekday at a date
Message-Id: <39E66E84.57BB8236@ai-lab.fh-furtwangen.de>
Malte Ubl wrote:
> Hi,
>
> I've been looking at the several Date modules provided but I wasnt
> able to figure out which one owuld be the right one to use for me,
> except probably DATE:Manip and that one states that it shouldnt be
> used in applicatons where performance is critical.
>
Ich bin nicht der Programmierergott aber ich mach einfach mal (einen
vielleicht unnützen) Vorschlag.
Gibt man in der Konsole unter Linux cal [Jahr] ein, erhält man den
Kalender des aktuellen Jahres, dieser geht bis
in das Jahr 5 oder so zurück.
Wenn Sie sich wirklich selber etwas zusammenbasteln wollen können Sie
diese Daten ganz einfach in eine Datei
ablegen und dann über einen Dateihandel darauf zugreifen.
Ich hoffe Ihnen geholfen zu haben,
Oliver Söder
------------------------------
Date: 12 Oct 2000 16:23:52 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Weekday at a date
Message-Id: <8s4oio$jc$1@solti3.sdm.de>
In article <slrn8uarl6.2uf.trammell@nitz.hep.umn.edu>, John J. Trammell <trammell@nitz.hep.umn.edu> wrote:
>>My problem is that I need to know which day was on a particular
>>date. An example problem would be to find out on which day of
>>the week you were born.
>>I basically need to implement this function:
>>sub weekday_of_date(someDate)
> One solution is:
> use Date::Calc qw[ Day_of_Week ];
> $dow = Day_of_Week($year,$month,$day);
Fastest possibility probably would be to use Perl's builtin function
"localtime()" (see "perldoc -f localtime"), but the range is only
1970 - 2038 (on most systems).
For the range 1955 - ... as in your case Date::Calc is indeed a feasible
solution, since it's written in C internally for maximum speed.
Regards,
--
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: Thu, 12 Oct 2000 11:16:37 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: will perl 5 work w/o server on my PC
Message-Id: <39E5E3E5.7C2F6AC6@mail.uca.edu>
Craig Berry wrote:
>
>
> I *did* go on to answer the question, you may have noticed. It just
> struck me as a humorously misdirected question.
Yes, I did notice that you interpreted it right on the second attempt,
and should have acknowledged that, but after coming out of teaching a
3-hour lab, I was too tired to be that thorough. Sorry.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
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 4597
**************************************