CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Can't locate XML/SAX/Writer.pm

 



metazone
New User

Dec 3, 2008, 1:29 PM

Post #1 of 4 (1994 views)
Can't locate XML/SAX/Writer.pm Can't Post

Trying to get simple perl script working w/ Net::LDAP::LDIF and use Net::LDAP::DSML. I want to read from an LDIF and convert to XML (DSML). Using ActiveState Perl on Windows Server 2003 SP2. Simple read from LDIF works ok; w/ DSML, I get the following: "Can't locate XML/SAX/Writer.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at C:/Perl/site/lib/Net/LDAP/DSML.pm line 36, <DATA> line 409."

In installed Net::LDAP from http://ldap.perl.org and then installed SAX Parser from http://search.cpan.org/~khampton/XML-SAX-Base-1.02/. I attached a screen shot of my perl/site/lib folder.

The code is as follows:


use Net::LDAP::LDIF;
use Net::LDAP;
use Net::LDAP::DSML;
use IO::File;
use XML::SAX::Base;

$fileNameDsml = "bootDsml.xml";
$ioDsml = IO::File->new($fileNameDsml,"w") or die ("failed to open $fileNameDsml as filehandle.$!\n");
$dsml = Net::LDAP::DSML->new(output => $ioDsml, pretty_print => 1 ) or die ("DSML object creation problem using an output file.\n");
$fileNameLdif = "boot.ldif";
$ldif = Net::LDAP::LDIF->new( "boot.ldif", "r", onerror => 'undef' );
while( not $ldif->eof ( ) )
{
$entry = $ldif->read_entry ( );
if ( $ldif->error ( ) )
{
print "Error msg: ", $ldif->error ( ), "n";
print "Error lines:n", $ldif->error_lines ( ), "n";
}
else
{
$dsml->write_entry($entry);
}
}
$ldif->done ( );


I must be missing something really basic ...

Thanks,

Bill

(This post was edited by metazone on Dec 3, 2008, 1:32 PM)
Attachments: perl site lib.JPG (44.8 KB)


KevinR
Veteran


Dec 3, 2008, 3:27 PM

Post #2 of 4 (1987 views)
Re: [metazone] Can't locate XML/SAX/Writer.pm [In reply to] Can't Post

With activeperl you use the PPM application to install modules. It might be possible to install them other ways but thats the way its done with activeperl.
-------------------------------------------------


metazone
New User

Dec 3, 2008, 5:27 PM

Post #3 of 4 (1985 views)
Re: [KevinR] Can't locate XML/SAX/Writer.pm [In reply to] Can't Post

Thx for the reply. I'd like to solely use ppm but some modules seem to be problematic. Currently, I can't get Text::IConv (a dependency for XML::SAX::Writer) to install on Windows -- it's not in ppm and, when I do it manually, I can't even generate the Makefile.

Specifically, 'perl Makefile.PL' results in the following: Checking for iconv ... fail; Failed to find iconv, please check your settings and re-run as: C:\Perl\bin\perl.exe Makefile.PL LIBS='-L/path/to/lib' INC='-I/path/to/include'

I saw online that others have had trouble building IConv, too. I tried their suggestions and couldn't get it to work. I wonder if anyone has successfully installed and used Perl-LDAP on Windows with DSML (I was able to get the ldif working but not the DSML b/c of installation problems).


KevinR
Veteran


Dec 3, 2008, 9:10 PM

Post #4 of 4 (1981 views)
Re: [metazone] Can't locate XML/SAX/Writer.pm [In reply to] Can't Post

You may want to switch to strawberry perl instead of activeperl:

http://www.strawberryperl.com

but you will have to uninstall activeperl before trying to install strawberry perl if you decide to give it a try.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives