Re: Convert int for string



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 <rwwebs@xxxxxxxxx> escreveu:

2007/8/26, Rodrigo Tavares
<digolinopage@xxxxxxxxxxxx>:
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 123@xxxxxxxxxxxx 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/
.



Relevant Pages

  • Re: Working with incoming calls
    ... "Grant Schenck" wrote: ... they can be with regards to operations and call states. ... dwNeededSize 56 unsigned long int ... As you can see both dwCallFeatures and dwCallFeatures2 are 0. ...
    (microsoft.public.win32.programmer.tapi)
  • Re: Malloc code
    ... Best regards ... I will have to just be carefull to not allocate more that 1.5 KB at any ... also said that for your compiler, int is 8 bits. ... declaration of malloc from your compiler's malloc.h. ...
    (microsoft.public.vc.language)
  • Re: help needed with filnames as command line arguments
    ... Tested on Bloodshed gcc and Cygwins gcc also in case you're ... 003 int printargstuff(int aa, char *bb); ... Regards ...
    (comp.lang.c)
  • Re: iostream.h trouble
    ... but complains about "cout (and cin) not declared in this scope"... ... Regards ... int main ...
    (comp.os.msdos.djgpp)
  • Re: unresolved external symbol
    ... Regards, ... > using namespace K1; ... > int APIENTRY _tWinMain(HINSTANCE hInstance, ... >>> a member of the my namespace. ...
    (microsoft.public.dotnet.languages.vc)