http://qs321.pair.com?node_id=312948


in reply to Perl Advent Calendar Daily Installer

This is a tad friendlier to the server
use strict; use warnings; use LWP::Simple 'get'; use XML::Simple; use CPAN; my $xml = XMLin( get( 'http://perladvent.org/perladvent.rdf' ) ); my $item = shift @{ $xml->{channel}{item} }; CPAN::Shell->install($1) if $item->{title} =~ /-\s(\S+)$/;
update: and here is the friendliest version possible
use strict; use warnings; use LWP::Simple 'get'; use XML::Simple; use CPAN; CPAN::Shell->install( XMLin( get( 'http://perladvent.org/perladventone.rdf' ) ) ->{channel}{item}{title} );

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: Perl Advent Calendar Daily Installer
by Aristotle (Chancellor) on Dec 08, 2003 at 12:54 UTC
    And for those of us who like to avoid the expat-based modules and prefer libxml2:
    use strict; use warnings; use LWP::Simple 'get'; use XML::LibXML; use CPAN; CPAN::Shell->install( XML::LibXML ->new() ->parse_string( get( 'http://perladvent.org/perladventone.rdf' + ) ) ->findvalue( '/rss/channel/item/title' ) );
    Actually for the RDF feed currently provided you can just use //title as the XPath expression.

    Makeshifts last the longest.