Hello Jeff,
See this simple script:
print "Enter with the fisrst number\n";
my $num = <STDIN>;
How I can to convert variable $num, in string ?
Best regards,
Rodrigo Faria
--- Jeff Pang <[EMAIL PROTECTED]> escreveu:
> 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.
>
Flickr agora em português. Você clica, todo mundo vê.
http://www.flickr.com.br/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/