Perl Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Perl Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SMTP
Socket / SSL
Spider
SFTP
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

(Perl) XML Parsing Example: Currency Data

Simple example showing how to parse an XML file containing currency data.

 Chilkat Perl Module Downloads for Windows, Linux, and MAC OS X

use chilkat();


$xml = new chilkat::CkXml();

#  The Chilkat XML component is freeware.

#  Load an XML document.
#  This file is available at http://www.chilkatsoft.com/testData/currency.xml

$success = $xml->LoadXmlFile("c:/myXmlFiles/currency.xml");
if ($success != 1) {
    print $xml->lastErrorText() . "\r\n";
    exit;
}

#  Iterate over each "CURRENCY" child node and display the contents:

$n = $xml->NumChildrenHavingTag("CURRENCY");
for ($i = 0; $i <= $n - 1; $i++) {
    # curr is a CkXml
    $curr = $xml->GetNthChildWithTag("CURRENCY",$i);
    print "----" . "\r\n";
    print "Name: " . $curr->getChildContent("NAME") . "\r\n";
    print "Code: " . $curr->getChildContent("CURRENCYCODE") . "\r\n";
    print "Country: " . $curr->getChildContent("COUNTRY") . "\r\n";

}


 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.