Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw


by mirod (Canon)
on Mar 19, 2001 at 20:26 UTC ( #65444=note: print w/ replies, xml ) Need Help??

in reply to

You XP whore you!

OK, I have just one comment on the use of XML::Twig (besides stating that this is how I use it myself most of the time): if you go through the pain of putting my ($t, $node) = @_; at the top of the anonymous sub you might as well use $node in the body:

NODE => sub { my ($t, $node) = @_; my $nodeid = $node->att ('id'); !exists ($nodehash {$nodeid}) or croak "N +ode $nodeid is duplicated!"; $nodehash {$nodeid} = {'nodeid' => $nodei +d, 'title' => $node- +>text, 'rep' => $node- +>att ('reputation'), 'last' => $node- +>att ('reputation'), 'date' => $node- +>att ('createtime') }; $t->purge; }

Also I found that -h does not work (-? does, you should check $args{h} on line 87, and I usually use $0 instead of hard-coding the name of the script in usage().

Good job anyway, it seems to be much faster than the previous version, 4 to 5 times faster actually!

Comment on Re:
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://65444]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-11-26 01:19 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls