NAME

Net::Connection::lsof - This uses lsof to generate a array of Net::Connection objects.

VERSION

Version 0.3.0

SYNOPSIS

use Net::Connection::lsof;

my @objects;
eval{ @objects = &lsof_to_nc_objects; };

# this time don't resolve ports, ptrs, or usernames
my $args={
         ports=>0,
         ptrs=>0,
         uid_resolve=>0,
         };
eval{ @objects = &lsof_to_nc_objects($args); };

SUBROUTINES

lsof_to_nc_objects

This runs 'lsof -i UDP -i TCP -n -l -P' and parses the output returns a array of Net::Connection objects. If a non-zero exit code is returned, it will die.

There is one optional argument and that is hash reference that can take several possible keys.

args hash

ports

Attempt to resolve the port names.

Defaults to 1.

ptrs

Attempt to resolve the PTRs.

Defaults to 1.

uid_resolve

Attempt to resolve the UID to a username.

Defaults to 1.

proc_info

Add assorted process information to the objects.

Defaults to 1.

my @objects;
eval{ @objects = &lsof_to_nc_objects( $args ); };

AUTHOR

Zane C. Bowers-Hadley, <vvelox at vvelox.net>

BUGS

Please report any bugs or feature requests to bug-net-connection-lsof at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Connection-lsof. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::Connection::lsof

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)