Tobiwan has asked for the wisdom of the Perl Monks concerning the following question:
This throw an error at compiletime because "_test2" is not defined. But it expected, that the object is an arrayreference. I found some cryptic description for "avhv" (don't know what this is) and som Perl-XS C libaries with methods that starts with "pad_", but as I sad, it's very cryptic for me. Can anyone help? Are there wise monks out there and share wisdom with me :)package MyClass; use strict; use warnings; local %MyClass::FIELDS; BEGIN { %MyClass::FIELDS = ('_test' => 1); } sub new { bless ['PackageName', 'value_of_"_test"'], $_[0] } package main; my MyClass $t = new MyClass(); print $t->{'_test2'};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Knowledge about typed lexicals and the access check
by Zaxo (Archbishop) on Apr 01, 2007 at 05:16 UTC |