NAME
Win32::Tracert - Call Win32 tracert tool or parse Win32 tracert output
VERSION
version 0.011
SYNOPSIS
use Win32::Tracert;
my $target = "127.0.0.1";
my $route = Win32::Tracert->new(destination => "$target");
if ($route->to_trace->found){
my $hops_value=$route->hops;
if($hops_value >= 1) {
print $route->destination_ip,"\n";
print $route->destination_hostname,"\n";
print "I got it\n";
}
}
Attributes
- *circuit
-
This attribute is used as argument before creating object. It contain the result of tracert output slurp from file. The result must be in array and dereferenced
- *destination
-
This attribute is used as argument before creating object. It containt IP adress or Hostname used by tracert to trace the path.
METHODS
path
This method is a mutator. It set its value if you pass an argument to it. Otherwise it return its current value like a standard get method. Path is call and set in to_trace method.
destination_hostname
This method returns the destination hostname. This information is defined if a route is found to destination.
destination_ip
This method returns the destination ip address. This information is defined if a route is found to destination.
to_trace
This method create a Win32::Tracert::Parser object from destination or circuit attribute. it set path attribute with the value return by to_parse method from Win32::Tracert::Parser object
found
This method check from tracert result if we reach the target destination.
hops
This method returns number of hops followed by tracert to reach destination. Value returned is a scalar.
SEE ALSO
* Win32::Tracert::Parser * Win32::Tracert::Statistics
AUTHOR
Sébastien Deseille <sebastien.deseille@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2015 by Sébastien Deseille.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.