RE: Much Coolness XML Wise.
> > How does the output compare to XML::Simple::XMLout() ? > I found XML::Simple::XMLout() to be deeply yucky, as it kind of randomly chooses to go for sub elements or attributes based on phases of the moon*. Also, it will happily output invalid XML if you have invalid data in your datastructure. Also it dies if given recursive structures. And it doesn't do binary data. I've found XML::Writer to be OK, although it doesn't do an 'export this data structure as XML' thing. You could use it write your own though. Or use XML::Dumper, I guess. *Something like all single nested items are made into attributes, or, if you prefer, nothing is made into attributes. Ick.
Re: Much Coolness XML Wise.
On Mon, 8 Jan 2001, Dean S Wilson wrote: >I've been involved in the debates on this list about Perl and Java and >I'd thought I'd say something nice for once. > >I've just spent three hours playing with XML::Generator and md5 >checksums, I was having problems building hash's of hash's with the >module (Seems to only add the last one in a foreach loop to the XML. >Gotta be me :)) and then with a quick glance at cpan I found >XML::Dumper. I don't know if I'm the only one here who didn't know >about this module but its Data::Dumper that outputs well formed xml. >Two minutes to read the docs and make a quick test script and tada! >Well formed xml files of my structures ready to be used. In under five >additional lines of code. How does the output compare to XML::Simple::XMLout() ? Cheers, Mike -- Mike Wyer <[EMAIL PROTECTED]> || "Woof?" http://www.doc.ic.ac.uk/~mw || Gaspode the Wonder Dog Work: +44 020 7594 8440|| Mobile: +44 07879 697119|| ICQ: 43922064
Re: Much Coolness XML Wise.
* Simon Wistow ([EMAIL PROTECTED]) wrote: > > > There are a few crypto modules on CPAN, although they all use C for the > > hard work. Whether they're available in PPMs for Activestate or not, > > I don't know. > > I'm doing a pure WML script implementation of MD5 at the moment that'd > be dead easy to port to Perl. Especially since Perl has things like > arrays which I always find useful for this sort of thing, grumble, > grumble, Wap rhymes with cr MIND THE WAP -- Greg McCarroll http://www.mccarroll.uklinux.net
Re: Much Coolness XML Wise.
> There are a few crypto modules on CPAN, although they all use C for the > hard work. Whether they're available in PPMs for Activestate or not, > I don't know. I'm doing a pure WML script implementation of MD5 at the moment that'd be dead easy to port to Perl. Especially since Perl has things like arrays which I always find useful for this sort of thing, grumble, grumble, Wap rhymes with cr
Re: Much Coolness XML Wise.
On Mon, Jan 08, 2001 at 07:06:28PM -, Dean S Wilson wrote: > I've just spent three hours playing with XML::Generator and md5 > checksums, I was having problems building hash's of hash's with the > module (Seems to only add the last one in a foreach loop to the XML. > Gotta be me :)) and then with a quick glance at cpan I found > XML::Dumper. I don't know if I'm the only one here who didn't know XML::Dumper sounds like the right solution for your problem, but FWIW, here's how I might do it with XML::Generator: use XML::Generator; my $gen = XML::Generator->new('conformance' => 'strict', 'escape' => 1); sub gen { ref $_[0] eq "HASH" ? $gen->hash(map { $gen->key($_), $gen->value(gen($_[0]->{$_})) } keys %{$_[0]}) : $_[0] } my $xml = gen({ hash => { of => "hashes" }}); Ben -- Benjamin HolzmanECNvantage Corp. Chief Technical Officer 295 Park Avenue S., Suite 7C (212) 358-0436 : [EMAIL PROTECTED] New York, NY, 10010 $ perl -le 'print join $" ,reverse map ucfirst ,qw{ hacker perl another just}'
Re: Much Coolness XML Wise.
On Mon, Jan 08, 2001 at 07:06:28PM -, Dean S Wilson wrote: > PS Does anyone know of any decent resources for perl crypto? (Other > than counterpane.com) Counterpane don't really have any perl stuff - or much crypto stuff :-) although Schneier's monthly Cryptogram is worth subscribing too. There are a few crypto modules on CPAN, although they all use C for the hard work. Whether they're available in PPMs for Activestate or not, I don't know. -- David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david Any technology distinguishable from magic is insufficiently advanced