OUTPUT:#!/usr/bin/perl -l # https://perlmonks.org/?node_id=1229668 use strict; use warnings; my $OutsideObject= bless( { 'first_row' => 0, 'aliases' => [], 'is_limited' => 1, 'joins_are_distinct' => undef, 'limit_clause' => '', 'custom_field' => bless( { '_class' => 'RT::CustomField', 'original_user' => undef,'_SB_Record_Primary_RecordCache_ke +y' => 'id=17', 'fetched' => {'valuesclass' => 1, 'order' => 1, 'canonicalizeclass' => 1 }, 'values' => { 'description' => 'Tipo de caso a ser tratado', 'maxvalues' => 1, 'name' => 'Case type', 'valuesclass' => undef, }, #### LINES ADDED #### To complete }, 'CUSTOMCLASS'), #### Missing information }, "OUTER_CLASS"); ### From your post my $CustomField = $OutsideObject->{custom_field}; print "VALUES->NAME = ", $CustomField->Values->Name , "\n"; BEGIN{ package CUSTOMCLASS; sub Values { my ($self) = @_; $self->{_INTERNAL_POINTER} = "values"; return $self; # Allow chaining } sub Name{ my ($self) = @_; $self->{_INTERNAL_POINTER} and return $self->{ $self->{_INTERNAL_P +OINTER} }->{name}; return $self->{name}; } 1; }
VALUES->NAME = Case type
As a computer, I find your faith in technology amusing.
In reply to Re: Get value from object
by NetWallah
in thread Get value from object
by danny20085
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |