Solved

Parse XML from Flash in Perl

Posted on 2007-03-28
6
286 Views
Last Modified: 2010-04-03
I've been searching all over the net but can't find a tutorial the explains how to parse xml from flash using Perl.  I've found some stuff with PhP but i don't have the time to learn a new language just for this one goal.

Basically, I have a Flash program that records some data from the user, turns it into XML and sends it out to a perl program on my server.  I need the perl program to parse the incoming XML into variables and then store the data on the server.  I, however, do not know how to do the parsing part.  Any help would be much appreciated!

Jeff
0
Comment
Question by:jeffgalak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 39

Expert Comment

by:Adam314
ID: 18809932
use XML::Simple;
use Data::Dumper;
my $ref = XMLin("/path/to/xml/file.xml");


print Dumper($ref);
0
 

Author Comment

by:jeffgalak
ID: 18810632
that looks find, but i'm not sure how Flash sends the data to the perl script.  So in flash i just use the command:

myXML.load("http://url/perlfile.pl")

This sends the xml data (in the variable myXML) to the per file.  How does the perl file then receive the XML data?
0
 
LVL 39

Expert Comment

by:Adam314
ID: 18811791
the myXML.load(url) is to get XML data from a file into flash.  Originally, it sounds as if you have XML data in flash, and want to get it to perl.

See here for more in the XML.load method:
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary843.html
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jeffgalak
ID: 18811865
That's my fault...i meant to type "myXML.send(url)"...so yes, i am trying to send FROM Flash to Perl
0
 
LVL 39

Accepted Solution

by:
Adam314 earned 250 total points
ID: 18812464
According to documentation, that will send the data using POST.
To read the data, use the CGI module.  Then use the XML::Simple module to parse it.  Here is an example:

#!/usr/bin/perl
use CGI qw/:standard/;
use XML::Simple;
use Data::Dumper;

#Get all data
my $data = $query->param('POSTDATA');

#Parse into XML::Simple object
my $ref=XMLin($data);

#Display results:
print header(-type  =>  'text/plain');
print Dumper($ref);

0
 

Author Comment

by:jeffgalak
ID: 18812779
Thanks for all the help!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question