LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Patrick Dupre Date: Sun Feb 7 23:08:15 2010 Subject: piddle in hash
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"} = $piddle ;
test_pdl (\%hash) ;
and
test_h (hash)
HV *hash
HE *he ;
pdl *p_pdl ;
CODE:
if (hv_exists_ent (hash, "A", 0)) {
he = hv_fetch_ent (hash, "A", 0, FALSE) ;
if (he) {
if (SvTYPE (HeVAL (he)) == SVt_RV) {
p_pdl = (pdl*) newRV_inc (SvRV (HeVAL (he))) ;
or
p_pdl = (pdl*) SvRV (HeVAL (he)) ;
PDL -> converttype (&p_pdl, PDL_D, 1) ;
}
}
}
What would the way of doing ?
Thank for your help.
---
==========================================================================
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
==========================================================================
| Navigate in group perl.beginners at sever nntp.perl.org | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by Zareef Ahmed
Powered By PHP Consultants |