On 8/25/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
> 2007/8/26, Rodrigo Tavares <[EMAIL PROTECTED]>:
> > Hello,
> >
> > In many languages there is a function for convert int
> > for string. Ho I can do it in Perl ?
> >
>
> Hello,
>
> Perl isn't a strong type language like C,so you don't have the need to
> convert the variable type distinctly.
> for example,
>
> my $x = 123;
> print $x * 2;
>
> would print 246 correctly,perl treat $x as an int type variable.
>
> but when you say,
>
> my $x = 123;
> print $x . '@abc.com';
>
> would print [EMAIL PROTECTED] joining $x with a string,Perl treat $x as
> a char variable.
>

There are certain situations where you can just call int($x) for some
operations.
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> http://learn.perl.org/
>
>
>


-- 
Rodrick R. Brown
http://www.rodrickbrown.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to