piddle in hash

piddle in hash

am 08.02.2010 00:08:15 von Patrick Dupre

---559023410-1903590565-1265584095=:28265
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

Hello,

I have been unsuccessful in getting the piddle values when I store them
in a hash so, I am asking to the list.
This works OK:
test_pdl (array)
pdl *array
CODE:
PDL -> converttype (&array, PDL_D, 1) ;

when I do: test_pdl ($piddle) ;


but when I do:
%hash {"A"} =3D $piddle ;
test_pdl (\%hash) ;

and
test_h (hash)
HV *hash
HE *he ;
pdl *p_pdl ;
CODE:
if (hv_exists_ent (hash, "A", 0)) {
he =3D hv_fetch_ent (hash, "A", 0, FALSE) ;
if (he) {
if (SvTYPE (HeVAL (he)) == SVt_RV) {
p_pdl =3D (pdl*) newRV_inc (SvRV (HeVAL (he))) ;
or
=09 p_pdl =3D (pdl*) SvRV (HeVAL (he)) ;
=09 PDL -> converttype (&p_pdl, PDL_D, 1) ;
=09 }
}
}


What would the way of doing ?
Thank for your help.


---
==================== =====3D=
==================== =====3D=
==================== ====
Patrick DUPRÉ | |
Department of Chemistry | | Phone: (44)-(0)-1904-434384
The University of York | | Fax: (44)-(0)-1904-432516
Heslington | |
York YO10 5DD United Kingdom | | email: pd520@york.ac.uk
==================== =====3D=
==================== =====3D=
==================== ====

---559023410-1903590565-1265584095=:28265
Content-Type: text/plain; charset=us-ascii

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

---559023410-1903590565-1265584095=:28265--

Re: piddle in hash

am 08.02.2010 15:44:28 von Patrick Dupre

---559023410-959030623-1265639548=:1078
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-ID:

On Sun, 7 Feb 2010, Patrick Dupre wrote:

> Hello,
>
> I have been unsuccessful in getting the piddle values when I store them
> in a hash so, I am asking to the list.
> This works OK:
> test_pdl (array)
> pdl *array
> CODE:
> PDL -> converttype (&array, PDL_D, 1) ;

Sorry, I finally I know how to do it.
I need to do INT2PTR
Sorry for the disturbing.

>
> when I do: test_pdl ($piddle) ;
>
>
> but when I do:
> %hash {"A"} =3D $piddle ;
> test_pdl (\%hash) ;
>
> and
> test_h (hash)
> HV *hash
> HE *he ;
> pdl *p_pdl ;
> CODE:
> if (hv_exists_ent (hash, "A", 0)) {
> he =3D hv_fetch_ent (hash, "A", 0, FALSE) ;
> if (he) {
> if (SvTYPE (HeVAL (he)) == SVt_RV) {
> p_pdl =3D (pdl*) newRV_inc (SvRV (HeVAL (he))) ;
> or
> =09 p_pdl =3D (pdl*) SvRV (HeVAL (he)) ;
> =09 PDL -> converttype (&p_pdl, PDL_D, 1) ;
> =09 }
> }
> }
>
>
> What would the way of doing ?
> Thank for your help.
>
>
> ---
> ==================== =====
==================== =====3D=
==================== =====3D
> Patrick DUPRÉ | |
> Department of Chemistry | | Phone: (44)-(0)-1904-434384
> The University of York | | Fax: (44)-(0)-1904-432516
> Heslington | |
> York YO10 5DD United Kingdom | | email: pd520@york.ac.uk
> ==================== =====
==================== =====3D=
==================== =====3D
>

--=20
---
==================== =====3D=
==================== =====3D=
==================== ====
Patrick DUPRÉ | |
Department of Chemistry | | Phone: (44)-(0)-1904-434384
The University of York | | Fax: (44)-(0)-1904-432516
Heslington | |
York YO10 5DD United Kingdom | | email: pd520@york.ac.uk
==================== =====3D=
==================== =====3D=
==================== ====

---559023410-959030623-1265639548=:1078
Content-Type: text/plain; charset=us-ascii

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

---559023410-959030623-1265639548=:1078--