1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#!/usr/bin/env perl
#
# This file is part of POE-Component-Client-MPD
#
# This software is copyright (c) 2007 by Jerome Quelin.
#
# This is free software; you can redistribute it and/or modify it under
# the same terms as the Perl 5 programming language system itself.
#
#
use warnings;
use strict;
use FindBin qw{ $Bin };
use lib "$Bin/../lib";
use POE;
use POE::Component::Client::MPD;
POE::Component::Client::MPD->spawn( {alias => 'mpd'} );
POE::Session->create(
inline_states => {
_start => \&start,
_stop => sub { print "bye-bye\n"; },
mpd_result => \&result,
}
);
POE::Kernel->run;
exit;
sub start {
my $k = $_[KERNEL];
$k->alias_set('client'); # increment refcount
$k->post( 'mpd', 'coll:all_files' );
}
sub result {
print "yeah!\n";
}
|