On Tue, Jan 19, 2010 at 11:28 AM, <christian4perl@lists.muthpartners.de>wrote:
> have a simple (?) question (it can be, that that is OT here; if it so,
> please tell me where I right).
http://www.perlmonks.org/
> The above dumped perl code looks like the
> following scriplet:
>
> $obj = bless({ '_request' => bless({'_uri' => bless ( "...", 'URI::http' )
> , '_uri_canonical' => $obj->{'_request'}{'_uri'}
> }, 'HTTP::Request' ) }, 'HTTP::Response' )
>
> How can perl's eval evaluate this code, at all?
Assuming $obj is initially undef,
$obj will be autovivified
$obj->{'_request'} will be autovivified
$obj->{'_request'}{'_uri'} will return undef.
$obj will be overwritten
You might as well have written
$obj = bless({ '_request' => bless({'_uri' => bless ( "...", 'URI::http' )
, '_uri_canonical' => undef
}, 'HTTP::Request' ) }, 'HTTP::Response' )
That's why you need to use Purity = 1 when using DD to generate code rather
than using it to debug.
Thread Previous