| version 1.52, 2008/02/18 19:13:32 |
version 1.56, 2009/07/08 18:16:41 |
|
|
| package Net::Telnet::Trango; |
package Net::Telnet::Trango; |
| |
|
| # $RedRiver: Trango.pm,v 1.51 2008/02/18 16:37:35 andrew Exp $ |
# $RedRiver: Trango.pm,v 1.55 2009/07/08 17:00:55 andrew Exp $ |
| use strict; |
use strict; |
| use warnings; |
use warnings; |
| use base 'Net::Telnet'; |
use base 'Net::Telnet'; |
|
|
| |
|
| =cut |
=cut |
| |
|
| our $VERSION = '0.01'; |
our $VERSION = '0.02'; |
| |
|
| my $EMPTY = q{}; |
my $EMPTY = q{}; |
| my $SPACE = q{ }; |
my $SPACE = q{ }; |
|
|
| [Decode => 0,]); |
[Decode => 0,]); |
| |
|
| Same as new from L<Net::Telnet> but sets the default Trango Prompt: |
Same as new from L<Net::Telnet> but sets the default Trango Prompt: |
| '/#>\s*\Z/' |
'/[\$#]>\s*\Z/' |
| |
|
| It also takes an optional parameter 'Decode'. If not defined it |
It also takes an optional parameter 'Decode'. If not defined it |
| defaults to 1, if it is set to 0, it will not decode the output and |
defaults to 1, if it is set to 0, it will not decode the output and |
|
|
| %args = @_; |
%args = @_; |
| } |
} |
| |
|
| $args{'Prompt'} ||= '/#>\s*\r?\n?$/'; |
$args{'Prompt'} ||= '/[\$#]>\s*\r?\n?$/'; |
| |
|
| foreach my $key ( keys %args ) { |
foreach my $key ( keys %args ) { |
| $PRIVATE{$key} = $args{$key}; |
$PRIVATE{$key} = $args{$key}; |
|
|
| } |
} |
| |
|
| my $new_mac = $mac; |
my $new_mac = $mac; |
| $new_mac =~ s/[^0-9A-Fa-f]//; |
$new_mac =~ s/[^0-9A-Fa-f]//g; |
| unless ( length $new_mac == 12 ) { |
unless ( length $new_mac == 12 ) { |
| $self->last_error("Invalid MAC '$mac'"); |
$self->last_error("Invalid MAC '$mac'"); |
| return; |
return; |