Phoenix.pm: Anyone doing Perl/XML?

Svirskas Rob-ERS007 Rob.Svirskas at motorola.com
Fri Mar 9 16:14:04 CST 2001


Doug;
     I'm pretty new to the XML stuff, so probably can't help much there (I've played with XML::Writer to generate XML once or twice, haven't tried Grove).

In a totally unrelated subject, last night in the midst of your lesson on Camel anatomy, we had briefly discussed slurping a file (I think while we were on the subject of $/). A while back, I started using sysread, as in:
          sysread HANDLE,my $slurp,-s HANDLE;

I suppose there could be some platform issues 'cause of the "-s", but it works fine on Solaris :-). The sysread runs faster and sucks down less CPU. Here's a benchmark for 1000 slurps of a 12 MB file:

Benchmark: timing 1000 iterations of do loop, sysread...
        do: 201 wallclock secs (108.34 usr + 90.51 sys = 198.85 CPU)
   sysread: 63 wallclock secs ( 0.04 usr + 63.39 sys = 63.43 CPU)

Here's the "do" I compared it against:
          my $slurp = do { local $/; <HANDLE>; };


                                                - Rob

-----Original Message-----
From: doug.miles at bpxinternet.com [mailto:doug.miles at bpxinternet.com]
Sent: Friday, March 09, 2001 3:05 PM
To: Phoenix.pm
Subject: Phoenix.pm: Anyone doing Perl/XML?


Anyone out there doing Perl/XML stuff?  I need to be able to convert
different data sources to XML.  I think that XML::Grove looks like my
best bet, but the documentation and examples are geared more towards
parsing rather than XML generation.  Any comments or suggestions?

-- 
- Doug

Encrypted with ROT-26 - all attempts to decrypt are illegal under the
DMCA!



More information about the Phoenix-pm mailing list