RE: quote marks in DBM

2004-02-08 Thread Hanson, Rob
> Must I abandon trying to get double-quote marks > into my hash element? No, it would be silly if the language didn't support that. And I want to apologize for my long winded answer that is to follow... I guess I just felt like typing. ... As for an answer I think some explanation is needed, o

quote marks in DBM

2004-02-08 Thread Rick Triplett
The following snippet of code is from "Programming the Perl DBI" and shows the storing of a hash element that contains both a comma and a sort-of double quote. (In the book, double quotes are shown; in the book-file, it looks like back tics and single quotes.) ... ### Insert some data rows $dat

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Jan Eden
Wiggins d'Anconia wrote: >Jan Eden wrote: >>$$PCEs[$cn]{$dh{"id"}} ... >> > >Adding an extra $ here causes Perl to look for $PCEs a scalar, which >doesn't exist rather than dereference the PCEs array. > Ok, I thought of a construction like $ {$PCEs[$cn]} {$dh{"id"}} ... This should be equivale

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Wiggins d'Anconia
Please group reply so everyone can help and be helped, and bottom post. Richard Heintze wrote: Wiggins and Jan, Thank you very much for such an extremely prompt response. You are right, I want my @PCEs = (); I'm using the Win32 ODBC API on acres of legacy code that does not "use stric

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Wiggins d'Anconia
Jan Eden wrote: Richard Heintze wrote: Is there a way I can explictly declare that each array cell contains a hash? Here is the only way I know to do it: my @PCEs=[]; while ($Data->FetchRow()) { my %dh = $Data->DataHash(); $PCEs[$cn]{$dh{"id"}} = $dh{"ridPCE"}; } This "my" declaration only says

Re: Modify date table

2004-02-08 Thread Jan Eden
smrtalec wrote: > >>Now the tricky thing: As long as there was an error in my script, it >>was >displayed in >my browser (thanks to CGI::Carp). But as soon as I >eliminated the obvious errors, I >get an Internal Server Error >(testing on my ISP's linux web server and on my local >OS X box, both >

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Jan Eden
Richard Heintze wrote: >Is there a way I can explictly declare that each array >cell contains a hash? > >Here is the only way I know to do it: > >my @PCEs=[]; >while ($Data->FetchRow()) { > my %dh = $Data->DataHash(); > $PCEs[$cn]{$dh{"id"}} = $dh{"ridPCE"}; >} > >This "my" declaration only says

Re: How to explicitly declare an array of hashes?

2004-02-08 Thread Wiggins d'Anconia
Richard Heintze wrote: Is there a way I can explictly declare that each array cell contains a hash? Only with a loop of some sort. Here is the only way I know to do it: my @PCEs=[]; This does not do what you think it does. This is assigning an anonymous array reference into the first element of

How to explicitly declare an array of hashes?

2004-02-08 Thread Richard Heintze
Is there a way I can explictly declare that each array cell contains a hash? Here is the only way I know to do it: my @PCEs=[]; while ($Data->FetchRow()) { my %dh = $Data->DataHash(); $PCEs[$cn]{$dh{"id"}} = $dh{"ridPCE"}; } This "my" declaration only says that it is an array, not an array o

Re: Modify date table

2004-02-08 Thread smrtalec
>Now the tricky thing: As long as there was an error in my script, it was displayed in >my browser (thanks to CGI::Carp). But as soon as I eliminated the obvious errors, I >get an Internal Server Error (testing on my ISP's linux web server and on my local >OS X box, both running Apache). > >Can an