On Wed, 21 Feb 2001, Jack H. Stanley wrote:

> I am trying to develop an internal "split" routine to use in decoding
> hash entries. The following dummy code illustrates the concept. It ,
> however refuses to allow access to the elements of the array. I have
> RTFM and CPAN examples and after two days give up - any hints will be
> appreciated.

[snip code]

>   svp = av_fetch(array, i, FALSE);
>   printf("ARRAY[x][%d] = %s\n",i,svp);

Not a C/XS programmer, but it looks like you need to dereference svp to a
SV*, then you can try to get at the string value.

    if (svp == NULL) {
        printf("ARRAY[x][%d] = undef\n", i);
    } else {
        printf("ARRAY[x][%d] = %s\n", i, SvPV_nolen(*svp));
    }


-- 
Tim Gim Yee
[EMAIL PROTECTED]

Reply via email to