> 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
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
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
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
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
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
>
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
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
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
>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
10 matches
Mail list logo