Perl
  Home arrow Perl arrow Page 3 - Using Perl With WDDX
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PERL

Using Perl With WDDX
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 2
    2002-08-07


    Table of Contents:
  • Using Perl With WDDX
  • The Big Picture
  • Packet Sniffer
  • Boyz 'N The Hood
  • All Mixed Up
  • Flying Toasters And Dancing Knives
  • Different Strokes
  • This Way Out

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using Perl With WDDX - Packet Sniffer
    ( Page 3 of 8 )

    All WDDX "packets" are constructed in a standard format.

    The root, or document, element for WDDX data is always the <wddxPacket> element, which marks the beginning and end of a WDDX block.


    <wddxPacket version='1.0'>
    This is immediately followed by a header containing comments,

    <header> <comment>This packet was generated on stardate 56937, constellation Omega </comment> </header>
    and a data area containing WDDX data structures.

    <data> ... </data> </wddxPacket>
    In order to perform its magic, WDDX defines a set of base data types that correspond to the data types available in most programming languages. Here's a list, with examples - pay attention, because you'll be seeing a lot of these in the next few pages:

    Strings, represented by the element <string> - for example

    <wddxPacket version='1.0'> <header/> <data> <string>Robin Hood</string> </data> </wddxPacket>
    Numbers, represented by the element <number> - for example

    <wddxPacket version='1.0'> <header/> <data> <number>5</number> </data> </wddxPacket>
    Boolean values, represented by the element <boolean> - for example

    <wddxPacket version='1.0'> <header/> <data> <boolean value='true'/> </data> </wddxPacket>
    Timestamps, represented by the element <dateTime> - for example

    <wddxPacket version='1.0'> <header/> <data> <dateTime>2002-06-08T16:48:23</dateTime> </data> </wddxPacket
    Arrays and hashes, represented by the elements <array> and <struct> respectively - for example

    <wddxPacket version='1.0'> <header/> <data> <array length='3'> <string>red</string> <string>blue</string> <string>green</string> </array> </data> </wddxPacket>
    Tabular data, represented by the element <recordset> - for example

    <wddxPacket version='1.0'> <header/> <data> <recordset rowCount='3' fieldNames='ID,NAME'> <field name='ID'> <number>1</number> <number>2</number> <number>3</number> </field> <field name='NAME'> <string>John</string> <string>Joe</string> <string>Mary</string> </field> </recordset> </data> </wddxPacket>
    Base64-encoded binary data, represented by the element <binary> - for example

    <wddxPacket version='1.0'> <header/> <data> <binary length='24'>VGhpcyBpcyBzb21lIGJpbmFyeSBkYXRh</binary> </data> </wddxPacket>
    The process of converting a data structure into WDDX is referred to as "serialization". The process of decoding a WDDX packet into a usable form is, obviously, "deserialization". The serializer/deserializer component is usually built into the programming language - as you will see on the next page, when I introduce Perl into the equation.

     
     
    >>> More Perl Articles          >>> More By icarus, (c) Melonfire
     

       

    PERL ARTICLES

    - More Perl Bits
    - Perl, Bit by Bit
    - Basic Charting with Perl
    - Using Getopt::Long: More Command Line Option...
    - Command Line Options in Perl: Using Getopt::...
    - Web Access with LWP
    - More Templating Tools for Perl
    - Site Layout with Perl Templating Tools
    - Build a Perl RSS Aggregator with Templating ...
    - Looping, Security, and Templating Tools
    - Perl: Bon Voyage Lists and Hashes
    - Templating Tools
    - Perl: Number Crunching
    - Perl Debuggers in Detail
    - Debugging Perl





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    Stay green...Green IT