clueless newbie has asked for the wisdom of the Perl Monks concerning the following question:
Greetings,
Given a stringified referent, how does one dereference it? IE: What does sub f need to be so that the results from (2) match the results from (1)?
Many thanks!
Given a stringified referent, how does one dereference it? IE: What does sub f need to be so that the results from (2) match the results from (1)?
Many thanks!
edited to remove {} block#! use Data::Dumper; use strict; use warnings; sub f { # (0) # }; my $str; my $ref=[1,2]; print Data::Dumper->Dump([\$ref],[qw(*ref)]); # (1) $str=''.$ref; print Data::Dumper->Dump([\$str],[qw(*str)]); # what do I need to do to $str so that (2) dump the original data stru +cture my $newref=f($str); print Data::Dumper->Dump([\$newref],[qw(*newref)]);# (2)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: dereferencing a stringfied referent
by almut (Canon) on Jun 12, 2010 at 09:47 UTC | |
by clueless newbie (Curate) on Jun 12, 2010 at 13:02 UTC | |
by clueless newbie (Curate) on Jun 12, 2010 at 16:33 UTC | |
Re: dereferencing a stringfied referent
by LanX (Saint) on Jun 12, 2010 at 12:13 UTC | |
by clueless newbie (Curate) on Jun 12, 2010 at 17:43 UTC | |
Re: dereferencing a stringfied referent
by sflitman (Hermit) on Jun 12, 2010 at 17:52 UTC |
Back to
Seekers of Perl Wisdom