in reply to Re^6: Shift returning pointer
in thread Shift returning pointer

You still left out the portion where you are reading from @{$EnvsToRun->{data}}. The thing to keep in mind here is that $EnvsToRun->{data} is a reference to an array. This array holds one entry per environment. That entry itself is a reference to another, inner array, which has 3 elements. I suspect you are reading it something like this:
my ($environment, $duration, $config) = @{$EnvsToRun->{data}};
That's not right, you'll get an array ref in $environment. You forgot that @{$EnvsToRun->{data}} holds many inner lists, each of them with 3 elements in it. To get the first one out by itself, you'd do something like this (note the ->[0]):
my ($environment, $duration, $config) = @{$EnvsToRun->{data}->[0]};
In practice, to deal with all of the combinations, you need to iterate over the outer array and then for each item there process the inner array. Like this:
for my $CurrentEnv (@{$EnvsToRun->{data}}) { my ($environment, $duration, $config) = @$CurrentEnv; ... }
If you don't want many inner lists, but just the one, you shouldn't be using push at all when assigning to $EnvsToRun->{data}. Instead, a simple assignment:
$EnvsToRun->{data} = [$environment, $duration, $config]; ... later ... ($environment, $duration, $config) = @{$EnvsToRun->{data}};

Replies are listed 'Best First'.
Re^8: Shift returning pointer
by rgb96 (Acolyte) on Mar 16, 2009 at 19:40 UTC

    I don't have to read from $EnvsToRun. Whatever you put in it just shows up in the treeview.

      Surely there is code that passes $EnvsToRun to a gtk method which creates the treeview. Which method is that, and what syntax are you using there?

        If there is code like that, it must be embedded in the simple list module. I don't have to type anything other than the push for it to show up in my graphical window