LWP::MainLoop - Give access to an single instance of LWP::EventLoop
use LWP::MainLoop qw(mainloop); mainloop->readable(\*STDIN, sub {sysread(STDIN, $buf, 100)}); mainloop->after(10, sub { print "10 sec later"} ); mainloop->run;
or
use LWP::MainLoop qw(readable after run); readable(\*STDIN, sub {sysread(STDIN, $buf, 100)}); after(10, sub { print "10 sec later"} ); run;
This module gives you access to an single instance of the LWP::EventLoop class. All methods of LWP::EventLoop can be exported and used as a procedural interface. The function mainloop() returns a reference to the single instance.
No functions are exported by default.
LWP::EventLoop
Copyright 1997-1998, Gisle Aas
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install LWP::UA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LWP::UA
CPAN shell
perl -MCPAN -e shell install LWP::UA
For more information on module installation, please visit the detailed CPAN module installation guide.