in reply to Working with values that dont exist

I don't think I understand your code very well, but it looks like you could try this:

      $graph_links[ $grid_no ] = $plot . ' ';

instead of:

      push @graph_links, $plot . ' ';

update: but when you do this you are removing the positional info anyway:

my $graph_links = join ('', @graph_links); @graph_links = split (/\s+/, $graph_links);