Posted on 2009-12-22 20:54:12-08 by cb2star
Field Type for reference to scalar?
This might sounds stupid but I can't find answer in the doc. So here it is: how to set the field type for a reference to scalar? E.g. in the class definition below, @sref is defined to hold a scalar reference. According to the doc, it should be :Type(SCALAR) since use 'ref' on this variable will output 'SCALAR'. However this doesn't work since OIO thinks it is a scalar, rather than the reference to the scalar. here is the code example: package test; { use Object::InsideOut 3.54; my @sref :Field #-->:Type(SCALAR) what type should be used here for scalar reference? :Arg(Name => 'sref', Mand => 1) :Acc(Name => 'sref') :Default(undef); ...... TIA, cb2star
Direct Responses: 12004 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.