Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a data-file which has numerical information on up to 96 different positions on a grid. e.g no 12 may be missing etc but the scale is from 1-96.
I am iterating through these lines in a foreach loop, extracting the grid reference number (1-96) and computing a clickable image leading to graphs etc for each position.
The problem is occuring when a particular number is missing, e.g if number 12 is missing graphs are produced for 1-95, not 1-11 and 13-96, meaning the grid number does not correspond to the graph created. I have tried using counters etc to get around this problem but nothing i working - I wondered if anyone had a simple logical way to get around this. Thankyou.
foreach my $line (@grid) { $line =~ s/^(\d+){1,2}//; $grid_no = $1; # @numbers and @data irrelevent $plot = plot_graph (\@numbers, \@data, $grid_no); push @graph_links, $plot . ' '; } my $graph_links = join ('', @graph_links); @graph_links = split (/\s+/, $graph_links); print qq(<P>Please click on a spot! <P>); print qq(<P><div align=center><img src=array.bmp border=0 usemap=#arra +y><map name=array><P>); print qq(<area href="http://biolarfs1/~khh103/cgi-bin/$graph_links[0]" + ALT="" shape="circle" coords="13,9,6">); ## etc ..........
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with values that dont exist
by broquaint (Abbot) on May 29, 2003 at 10:09 UTC | |
by Anonymous Monk on May 29, 2003 at 11:15 UTC | |
by broquaint (Abbot) on May 29, 2003 at 13:44 UTC | |
by hangmanto (Monk) on May 29, 2003 at 12:40 UTC | |
|
Re: Working with values that dont exist
by fglock (Vicar) on May 29, 2003 at 12:40 UTC |