RPC::Async::URL - Utility functions to handle URLs
use RPC::Async::URL; my $socket1 = url_connect("tcp://1.2.3.4:5678"); my $socket2 = url_connect("open://dir/file.pl", "--my-option"); my ($stdout, $stderr) = url_connect("open2://dir/file.pl", "--my-option"); my ($socket3) = url_connect("unix://mysocket.sock"); my ($socket4) = url_connect("perl://perlsrvd.pl");
Turns an URL into a socket. Currently supported schemes are: * (tcp|udp)://HOST:PORT, Returns a udp of tcp socket. * (unix|unix_dgram)://path/file.sock, Returns a unix domain socket connection. * (perl|perlroot|perl2|perlroot2)(header)?://path/file.pl, Starts a new perl and loads a default header unless it ends in header, then first argument is used as header. It also connects a socket between the two and returns that. Urls with 2 in the end also returns $pid, stdout and stderr. Urls with root in them does not drop root privilages after starting the process the others will. * open2://file, run file and return stdout, stderr and the $pid.
Make urls paths absolute, by adding $cwd to all urls.
Wait for url to disconnect
Explode URL components into smaller bits, only supports tcp and udp.
Same as connect, just returns a listening socket instead. Only tcp://, udp:// and unix:// supported.
Jonas Jensen <jonas@infopro.dk>, Troels Liebe Bentsen <troels@infopro.dk>
Copyright(C) 2005-2007 Troels Liebe Bentsen
Copyright(C) 2005-2007 Jonas Jensen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install RPC::Async, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPC::Async
CPAN shell
perl -MCPAN -e shell install RPC::Async
For more information on module installation, please visit the detailed CPAN module installation guide.