From: "Miguel Angel Morales" <[EMAIL PROTECTED]>
> Hi All! I have a problem concatenating strings and I will be very
> grateful if you could help me because I'm going crazy:
> 
> I'm using the telnet library for connecting to a router and executing
> the following command:
> 
> $t->cmd("ip $nombre $servidor -prefix_len 126 -destination_ip_address
> $cliente -connect_type point");
> 
> $servidor and $cliente variables contain IPv6 address that I get from
> a MySQL Data Base (BLOB type). When I try to execute the command as
> before the string is always truncate after the $servidor variable.
> Something like this:
> 
>                     ip tb-003 2001:800:10:2a04::10
>                     -prefix_len 126 ...
> 
> So the router tries to execute each sentence independently.
> 
> But if I change the $servidor variable for the value it contains, the
> command is not truncated and the router executes it correctly.

Most probably the variable contains a newline or some other 
whitespace character like this. Try to print it out with

        print ">$servidor<\n";

Does that look right?

Maybe you'll have to chomp($servidor) or
        $servidor =~ s/\s+$//;
or whatever. If you want to be sure what character is it try this:

        $hex = unpack('H*', $servidor); 
        $hex =~ s/(..)/$1 /g; 
        print $hex;

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to