<?xml version="1.0" encoding="windows-1252"?>
<node id="984280" title="How to access the contents of a specific memory address?" created="2012-07-29 08:08:04" updated="2012-07-29 08:08:04">
<type id="115">
perlquestion</type>
<author id="672289">
pat_mc</author>
<data>
<field name="doctext">
Esteemed Monks,&lt;br&gt;
&lt;br&gt;
I am having some trouble trying to print the actual contents of a specific memory address. Essentially, I am trying to emulate C-type pointer dereferencing with basic Perl commands (rather than any specially designed modules).  While I can easily obtain the memory address of a given variable,
&lt;code&gt;
perl -e '$a=5;printf "%p\n", $a'
&lt;/code&gt;
I do not know how to print the contents of a given memory address (e.g., '0xe98af0'). I am sure there is an easy way to do it in Perl but I haven't been able to find it.&lt;br&gt;
&lt;br&gt;
Any help with this would be much appreciated.&lt;br&gt;
&lt;br&gt;
Kind regards -&lt;br&gt;
&lt;br&gt;
Pat</field>
</data>
</node>
