rajiyer has asked for the wisdom of the Perl Monks concerning the following question:
and the perl code is :for (int i = 0; i < 10; i++) { ... perl_call_pv("PerlCode::addKeyValue", G_EVAL|G_SCALAR); ... }
Now, I want to write another function in Perl, that would modify this hash, (say add another key - value) and I want to return this hash back to the C code. How do I do this? Thanks in advance, Rajsub addKeyValue { ($key, $value} = @_; push @{${$self->{$hash}}{$key}}, $value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Return a hash from Perl to C
by PodMaster (Abbot) on Apr 15, 2003 at 11:44 UTC | |
|
Re: Return a hash from Perl to C
by tall_man (Parson) on Apr 15, 2003 at 04:18 UTC |