>>>>> "Wiggins" == Wiggins D Anconia <[EMAIL PROTECTED]> writes:

Wiggins> Out of curiousity, why/when *in Perl* would you take a reference to
Wiggins> something that holds a reference?  And, "how deep does the well go?"
Wiggins> (how far will Perl take the above indirection?)... I suppose I could
Wiggins> just test, but I am rather lazy...

For the same reason you might take a reference to a scalar
otherwise...  indirection.

For example, I might have

        my $active_table = [EMAIL PROTECTED];

and then I want to call a subroutine to decide a new active table:

        adjust_table(\$active_table);

        sub adjust_table {
                my $table_ref = shift;
                $$table_ref = rand(2) > 1 ? [EMAIL PROTECTED] : [EMAIL PROTECTED];
        }

I can't change $active_table except by reference.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to