Andrew Gaffney <[EMAIL PROTECTED]> wrote:
: 
: I think that 'my' is bad because I have something similar to:
: 
: my %tree;
: 
: sub return_an_arrayref() {
:    my @array = ('thing1', 'thing2', 'thing3');
:    return [EMAIL PROTECTED];
: }
: 
: sub build_tree() {
:    foreach(@thing) {
:      $tree{$_} = return_an_arrayref();
:    }
: }
: 
: use Data::Dumper;
: print Dumper(%tree);
: 
: The output shows a bunch of empty arrays or arrays with
: all undef elements under each key in %tree. I know
: return_an_arrayref() is returning data because I can
: print all the elements out in build_tree().

Remember Finagle's Third Law:

 "In any collection of data, the figure most obviously
  correct, beyond all need of checking, is the mistake."


    Your results indicate that return_an_arrayref() does
sometimes return a reference to an empty array. Show us
unedited code for more help.


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328





-- 
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