#!/usr/bin/perl #Brodie Reuter #SNC Arboretum Project - CSCI 460 open(INFILE, ") { # $_ = FAILS on EOF $trees[$i]=$_; # line read $i++; } close(INFILE); open(OUTFILE, ">snc_script.js") or die "Cannot create script.js .\n"; #open output file to make new Javascript file print OUTFILE "function initialize() {\n"; print OUTFILE "var locations = \[\n"; $t = 0; foreach (@trees) { #split the data in the file into relevant parts for displaying in map @attrib = split (/;/, $_); $num[$t] = $attrib[0]; $lat[$t] = $attrib[1]; $longt[$t] = $attrib[2]; $title[$t] = $attrib[3]; $desc[$t] = $attrib[4]; $link[$t] = $attrib[5]; chomp ($link[$t]); # '-' sign creating processing problem foreach (@longt) { @longfix = split (/-/, $_); $longt = $longfix[1]; } #every time loop processes it prints another line of Javascript for the map print OUTFILE <More Info', $lat[$t], $longt[$t], $num[$t], '$title[$t]'], TTT $t++; } #prints the needed Javascript code for the map to display, centering a map in the center of campus, found on Android Developer print OUTFILE <