in reply to C-like Pointers
Even in C that doesn't access RAM. It access virtual memory, the process's memory space.
Scalars are fundamentally different than raw bytes of memory. Perl is free to allocated and deallocated scalars, convert strings between two internal formats, and convert between types at will, even when you only look at the scalar.
You are really asking for a means of accessing "arbitrary" addresses within the process's memory space. That's definitely possible via an XS module. Start your search on CPAN.
Mind you, it's possible to use a scalar (and other types of variables) as an interface to functions such that fetches call one function and sets call another. The feature is call "magic", and tie is one form of this. The downside is this slower than calling the underlying functions directly.
That said, I can't help but think we should review your decision to go down this path. What is the real problem you are trying to solve?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: C-like Pointers
by DerHartmut (Novice) on Nov 16, 2009 at 03:34 UTC | |
by snoopy (Curate) on Nov 16, 2009 at 05:11 UTC | |
by DerHartmut (Novice) on Nov 16, 2009 at 17:34 UTC |