Form to my perl-script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pknudsen
    New Member
    • Feb 2010
    • 2

    Form to my perl-script

    I have a script that change a gpx-file. Some of the commands has to be deleted.
    Code:
    $filename = "tourfile.gpx";
    local ($^I, @ARGV) = ('.bak', $filename);
    while (<>) {
      print unless m|<extensions>| .. m|</extensions>|;        
    }
    This script deletes the "excentions " commands.
    I want to make a form so I can load the filename to the script true this form.
    After the file has been made I want to rename it to a xml-file.

    Can somebody help me?
    Last edited by numberwhun; Feb 22 '10, 06:23 PM. Reason: Please Use CODE Tags!!!
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    If you create a form to have someone input a script name, then you have to have to worry about cgi and such. Why not just take the script and modify it to accept an argument to the script? Would that be a possibility?

    Comment

    • pknudsen
      New Member
      • Feb 2010
      • 2

      #3
      I show here the (a part) of the source of my program:
      Code:
         <script src="loadgpx.4.js" type="text/javascript"></script>
      		<script type="text/javascript">
      		//<![CDATA[
       
      		var MyMap;
       
      		function LoadGPXFileIntoGoogleMap(map, filename)
      		{
      			// Remove any existing overlays from the map.
      			map.clearOverlays();
       
      			var request = GXmlHttp.create();
      			request.open("GET", filename, true);
      			request.onreadystatechange = function()
      			{
      				if (request.readyState == 4)
      				{
      					parser = new GPXParser(request.responseXML, map);
      					parser.SetTrackColour("#ff0000");					// Set the track line colour
      					parser.SetTrackWidth(5);							// Set the track line width
      					parser.SetMinTrackPointDelta(0.001);				// Set the minimum distance between track points
      					parser.CenterAndZoom(request.responseXML, G_HYBRID_MAP); // Center and Zoom the map over all the points.
      					parser.AddTrackpointsToMap();						// Add the trackpoints
      					parser.AddWaypointsToMap();							// Add the waypoints
      				}
      			}
      			request.send(null);
      		}
       
      		function onLoad()
      		{
      			MyMap = new GMap2(document.getElementById("map"));
      			MyMap.addControl(new GLargeMapControl());
      			MyMap.addControl(new GMapTypeControl());
      			LoadGPXFileIntoGoogleMap(MyMap, "blog/2005-07/gurreso2.gpx");
      		}
       
      		//]]>
      		</script>
      	</head>
      	<body onload="onLoad()">
      		<div id="map" style="width: 100%; height: 100%;"></div>
      	</body>
      </html>
      I have experienced that I don't need the "<excention s>"-statement.
      I need to load the gpx-file into the code through a inputform AND rename it to a .xml-file.
      Maybe I don't need to rename, but it only works if I start to rename the gpx-file.

      Can anybody help me?
      Last edited by numberwhun; Feb 23 '10, 10:21 PM. Reason: Please Use CODE Tags!!!

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        You need to really learn to use code tags. They are required around code you post into the forums. If you do not know how to use them, then please read #11 here.


        Looking closer at the code, now that you have provided it, this is not Perl, but is instead Javascript. I am moving this to the javascript forum.

        Regards,

        Jeff

        Comment

        Working...