Help with variable reference in perl OOD

From: Tammer (tammer12_at_yahoo.com)
Date: 04/19/04


Date: 19 Apr 2004 12:37:38 -0700

I need to be able to set a variable equal to the value of an OOD
reference such that when the reference changes, the the variable
changes as well (usually accomplished with: $var = \$other_var), but
when I do this "$var" references the HASH entry for the object, not
its value stored. Ex:

#!/usr/bin/perl
$Data1 = object ("data");

print "$Data1->{'VAL'}\n";
$temp=\$Data1->{'VAL'};
print "$temp\n";

sub object {
        my $objAddress={};
        $objAddress->{'VAL'}=shift;
    bless ($objAddress);
    return ($objAddress);
}

If you run this bit of code the output is:

> temp
> SCALAR(0x40016c2c)

So clearly $temp isn't being assigned the value stored in
$Data1->{'VAL'}, which is what I want (and I want $temp to change with
$Data1->{'VAL'} changes). This is my first endeavor in perl OOD and
I'm stuck. Please help!



Relevant Pages

  • Re: ACCESS97, try to relink reference to another MDB
    ... when you move your application to the second machine, the reference to ... Dim ref As Reference ... Set ref = Application.References ... Dim temp$, resp ...
    (comp.databases.ms-access)
  • Re: Safely Raising Events in Multithreaded app.
    ... The meaning of taking a temp reference is that if the last subscriber of the ... the TestEvent would be null and the TestEventcall ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SYS$QIOW - Performance Issue
    ... you would see a reference count of 2. ... $OPEN /READ/WRITE TEMP MBAnnn: ... stuck in the WRITE statement and you might need to kill the process. ... for the reading process to read from mailbox). ...
    (comp.os.vms)
  • Re: Sumproduct troubleshooting (new to me)
    ... True to return the row part of the reference as ... ColumnAbsolute Optional Variant. ... 'Make Lambda and Temp Distribution Plots ...
    (microsoft.public.excel.programming)
  • Re: Public variables and separate library files
    ... You would need to create a reference from the file needing to use the ... > Public temp As Integer ... > Sub Master() ... > MsgBox ...
    (microsoft.public.excel.programming)