in reply to Creating an image map using Perl code
This produces two circular links, centres at 100,100 and 200,200, with radius 50. Very roughly, something like this:#!/usr/bin/perl my @x_points = ( 100, 200 ); my @y_points = ( 100, 200 ); my @radiuses = ( 50, 50 ); my @websites = qw( http://www.yahoo.com http://www.google.com ); print q( <IMG SRC="figure.gif" USEMAP="#mymap" width="400" height="400"> <MAP NAME="mymap"> ); for ( my $i = 0 ; $i < @x_points ; $i++ ) { print qq(<AREA SHAPE="circle" COORDS="$x_points[$i],$y_points[$i],$radiuses[$i]" HREF="$websites[$i]"> ); } print q(</MAP>);
But what your code is crying out for is a nice little AoH containing all the data in a much better structure. Exercise for the reader etc.###################################################### # # # # # ###### # # ## ## # # # # # # # # <-yahoo # # # # # # ## ## # # ###### # # ###### # # ## ## # # # # # # # # <- google # # # # # # ## ## # # ###### # # # # # # # # # # # # # # # # # # # # # ######################################################
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating an image map using Perl code
by lampros21_7 (Scribe) on Apr 06, 2006 at 09:27 UTC | |
by Anonymous Monk on Apr 06, 2006 at 10:22 UTC | |
by lampros21_7 (Scribe) on Apr 06, 2006 at 15:24 UTC |