Convert-TLI
view release on metacpan or search on metacpan
lib/Convert/TLI.pm view on Meta::CPAN
query tli tcp /dev/tcp 0x0002333337f00001
=head1 SYNOPSIS
use Convert::TLI;
my $tli = Convert::TLI->new();
my ($ip, $port) = $tli->decode_tli('0x0002333337f00001');
print "Server $ip @ $port";
my $decoded = $tli->encode_tli($ip,$port);
print "Got encoded: $decoded";
=head1 DESCRIPTION
This module provides functions to convert strings to/from the TLI style encoding
as described L<infocenter.sybase.com|http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc35823.1572/doc/html/san1334282782407.html>
=head1 FUNCTIONS
=over 4
lib/Convert/TLI.pm view on Meta::CPAN
my $encoded = Convert::TLI->new();
Create Convert::TLI object.
Possible options:
C<prefix> and C<nulls>
It will be the prefix and suffix for encripted line only
my $encoded = Convert::TLI->new( prefix=>'XXXX', nulls=>'000' );
my $decoded = $tli_decoded->encode_tli($ip,$port);
print "Got encoded: $decoded";
XXXX....000
=item *
C<encode_tli>
my $encoded = encode_tli("192.168.0.1", "3100");
Encode a string of bytes into its TLI representation.
lib/Convert/TLI.pm view on Meta::CPAN
C<decode_tli>
my ( $ip, $port ) = decode_tli("0x0002333337f00001");
Decode a TLI string into a string of bytes.
=item *
C<detect_tli>
my $decoded = ( detect_tli("0x0002333337f00001") )
? 'You have TLI style'
: 'Regular IP style';
Detect is string TLI styled
=back
=head1 AUTHOR
t/Convert-TLI.t view on Meta::CPAN
use Test::More tests => '5';
BEGIN { use_ok('Convert::TLI') };
#########################
my $tli = Convert::TLI->new();
ok( $tli->detect_tli('0x0002333337f00001'), "TLI detection" );
my ($ip, $port) = $tli->decode_tli('0x0002333337f00001');
ok( $ip eq '55.240.0.1', "Got IP" );
ok( $port eq '13107', "Got port" );
my $decoded = $tli->encode_tli($ip,$port);
ok( $decoded eq '0x0002333337f00001', "Encoded TLI" );
( run in 0.288 second using v1.01-cache-2.11-cpan-26ccb49234f )