I finally finished building my locator script the only thing I can't seem to get to go it a sort of the output by distance actually $km looking for some wisdom on this one.
$count = 0; open(FILE, "herbalarea.pl") || die "I can't open that because: $!\ +n"; while(<FILE>) { chop; @all = split(/\n/); foreach $line (@all) { local($hStoreID, $hStoreName, $hStoreUserName, $hStorePassword, $h +StoreMCRSPassword, $hStoreCity, $hStoreProv, $hStoreAdd, $hStoreAdd2, + $hStorePC, $hStoreCountry, $hStoreEmail, $hStorePhone, $hStoreType, +$hStoreLatitude, $hStoreLongitude, $hStoreFirstName, $hStoreLastName, + $hStoreHPhone, $hStoreCPhone, $hStoreEmail2, $hStoreOwner, $hStoreAd +min, $hStoreAdmin2, $hStoreAdmin3, $hStoreActive, $hStoreWeb, $hStore +Lang, $hStoreDesc, $hStoreShowMap, $hStoreComingSoonText, $hStoreComi +ngSoonTextFrench, $hStoreVanityName, $hStoreWebCreatedDate, $hStoreLa +stLogin, $hStoreLastEnabled, $hStoreManagerEmpID, $hStoreURL) = split +(/ /, $line); $lat2 = $hStoreLatitude; $lon2 = $hStoreLongitude; $lat1 = $lat1a; $lon1 = $lon1a; @L = (deg2rad($lat1), deg2rad(90 - $lon1)); @T = (deg2rad($lat2), deg2rad(90 - $lon2)); $km = great_circle_distance(@L, @T, 6378); if ($km < $distance) { $match = 1; $count ++; $area = "$hStoreName <BR> $hStoreAdd <br> $hStoreCity, $hStorePro +v $hStorePC\n"; $area1 = "$hStoreAdd $hStoreAdd2 $hStoreCity, $hStoreProv $h +StorePC\n"; $area2 = "$hStoreCity, $hStoreProv\n"; print " <table border=0 width=240 height=105 cellpadding=15 cellspacing=0 back +ground=\"http://pagelinx.com/herbalmagic/files/loc_bck.gif\"> <tr> <td style=\"font-size: 11px; color: #5D5D5D;\"> Store # <A HREF=\"javascript:change1('pic1','image$count')\">$area</A> +<BR>\n"; print "<div class=\"book\"> <A HREF=\"http://www.pagelinx.com/herbalmagic/form.php?center=$hStoreN +ame&address=$hStoreAdd&city=$hStoreCity&prov=$hStoreProv\" target=_pa +rent>Book Your Free Consultation</a> - KM $km</div></A></td> </tr> </table> \n"; } } }

In reply to Sort output by pglinx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.