Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: converting a C pointer to a perl reference

by creamygoodness (Curate)
on Jan 23, 2006 at 15:13 UTC ( [id://524944]=note: print w/replies, xml ) Need Help??


in reply to converting a C pointer to a perl reference

Hmm. I'm not sure why that might be a problem. There's a HAS_64K_LIMIT defined in dosish.h, but it seems unlikely to be related. Try this as an alternative and see what happens.

htm_sv = newSV(filesize + 1); SvPOK_on(htm_sv); SvCUR_set(filesize); ptr = SvPVX(htm_sv); Copy(*htmFile, ptr, filesize, char); XPUSHs(sv_2mortal(htm_sv));

(newSVpvn takes two arguments -- a char* and a STRLEN -- while I only see one in your example... but I assume that's just a typo, as it would have been a compile-time error and there's no equivalent that uses only one arg.)

--
Marvin Humphrey
Rectangular Research ― http://www.rectangular.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://524944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-03-29 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found