# Pastebin 7vdKxR3r sub MAIN { react { whenever %configuration.IO.watch -> $event { harvest($event.path) if $event.event ~~ FileChanged; } } } sub harvest($path) { my @wireless-clients = from-xml(slurp($path)).root.elements(:TAG('wireless-client'), :RECURSE); parse(@wireless-clients, $path); expunge($path); } sub parse(@wireles-clients, $path) { my Int $count; say "Parsing $path."; for @wireles-clients { say $count++; #my %client-data = client => } } sub reap() {} sub expunge($path) { say "Complete, removing $path."; unlink($path); }