As I've seen it here before and it's really rather backward code. What you're doing is joining all the elements of @graph_links on a empty delimiter to produce a string, and then splitting the string on all the whitespace to produce @graph_links without whitespace. It would make much more sense to just leave out the whitespace in the first place (in your particular case) and completely skip that.my $graph_links = join ('', @graph_links); @graph_links = split (/\s+/, $graph_links);
Also, what are you trying to achieve in that inner loop? All you're doing is looping 96 time and pushing the results of plot_graph() onto @graph_links plus some extraneous whitespace, which makes the @points array a little redundant. Perhaps you mean to create the @graph_links array like this
Then when you iterate over the @graph_links array later on, skip any elements that aren't defined e.g## don't bother with @points as it looks to be redundant push @graph_links, ( /^(\d{1,2})$/ ? plot_graph (\@temps, \@new, $1) : undef );
This way any undefined elements will be skipped so you should get the effect of 1-11, 13-96.for my $p (@graph_links) { next unless defined $p; print ... }
_________
broquaint
In reply to Re: Re: Re: Working with values that dont exist
by broquaint
in thread Working with values that dont exist
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |