Thank you very much Jenda, I used the code

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

you send me and at the end of the register appears the 0D 0A hex characters,
so this should be the problem.
How can I remove this characters from the variable?

Thanks again,

Miguel Angel

----- Original Message -----
From: "Jenda Krynicky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 19, 2003 1:10 PM
Subject: Re: string concatenation


> 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]
>

*****************************
Madrid 2003 Global IPv6 Summit
Presentations and videos on-line at:
http://www.ipv6-es.com



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

Reply via email to