Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I have a text file in which i have some scalar reference addresses like SCALAR(1xAc435), SCALAR(1xAc436) etc.

Is it possible to replace those addresses with their corresponding values by dereferences using those addresses in the scalar file.

Example:
Text file:
here the text goes.. SCALAR(1xAc435) like this here the text goes.. SCALAR(1xAc436) like this

output:
here the text goes.. <table id="1">....</table> like this here the text goes.. <table id="2">....</table> like this

Thanks in advance

Replies are listed 'Best First'.
Re: doubt in address substitution
by gellyfish (Monsignor) on May 10, 2005 at 09:48 UTC

    No. The stringified references are meaningless in this context.

    /J\

Re: doubt in address substitution
by jhourcle (Prior) on May 10, 2005 at 10:12 UTC

    If the output from your program is all that you have, then no, you can't rebuild, as all the reference tells you where perl was storing the value that you cared about.

    If you have the program that generated that file, and all of the input that it took, then you may be able to modify it, and re-run it, so that it generates the output you are looking for. If that's the case, I'd suggest that you post the program that generated the output.

Re: doubt in address substitution
by merlyn (Sage) on May 10, 2005 at 10:09 UTC