Re: Convert int for string

2007-08-26 Thread Xavier Noria
On Aug 26, 2007, at 3:52 PM, Peter Scott wrote: The term "strong typing" is so ill-defined as to make this an angels-dancing-on-a-pinhead discussion and unlikely to lead to any enlightenment. Even the Wikipedia definition says that there *is* no accepted definition and some of the common usages

Re: Convert int for string

2007-08-26 Thread Peter Scott
On Sat, 25 Aug 2007 18:22:13 -0700, (Randal L. Schwartz) wrote: >> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes: > > "Jeff> Perl isn't a strong type language like C,so you don't have the need to > "Jeff> convert the variable type distinctly. > > Perl is a very strongly typed language. T

Re: Convert int for string

2007-08-26 Thread Xavier Noria
On Aug 26, 2007, at 3:22 AM, Randal L. Schwartz wrote: Perl is a very strongly typed language. The problem is that people keep thinking "number" or "string" is a type in Perl. It isn't. The type is called "scalar". Other types are "array" and "hash" and "filehandle" and "dirhandle" and

Re: Convert int for string

2007-08-25 Thread Randal L. Schwartz
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes: "Jeff> Perl isn't a strong type language like C,so you don't have the need to "Jeff> convert the variable type distinctly. Perl is a very strongly typed language. The problem is that people keep thinking "number" or "string" is a type in P

Re: Convert int for string

2007-08-25 Thread Dr.Ruud
Rodrigo Tavares schreef: > print "Enter with the fisrst number\n"; > my $num = ; > > How I can to convert variable $num, in string ? $num already contains a string. When you input 1 2 3 , it will contain "123\n". With chomp() you can remove the newline, but you can also use int(), see `perldoc -

Re: Convert int for string

2007-08-25 Thread Tom Phoenix
On 8/25/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote: > In many languages there is a function for convert int > for string. Ho I can do it in Perl ? It's so easy to put a number into a string, we don't have a function for it. We simply interpolate: my $age = 6 * 7; # or any other number pri

Re: Convert int for string

2007-08-25 Thread Mr. Shawn H. Corey
Rodrigo Tavares wrote: Hello, I want to convert the int for string, then use the function lenght, and return the size of string. How It is possible ? Perl automatically converts a number to and string (and back again) as needed. To get the length of its string, use the length function: my

Re: Convert int for string

2007-08-25 Thread Rodrigo Tavares
Hello, I want to convert the int for string, then use the function lenght, and return the size of string. How It is possible ? Best regards, Rodrigo Faria --- Jeff Pang <[EMAIL PROTECTED]> escreveu: > 2007/8/26, Rodrigo Tavares > <[EMAIL PROTECTED]>: > > Hello Jeff, > > > > See this simple s

Re: Convert int for string

2007-08-25 Thread Jeff Pang
2007/8/26, Rodrigo Tavares <[EMAIL PROTECTED]>: > Hello Jeff, > > See this simple script: > > print "Enter with the fisrst number\n"; > my $num = ; > > How I can to convert variable $num, in string ? > This is really depend on what operation context the variable is in. As I've said,when you use it

Re: Convert int for string

2007-08-25 Thread Rodrigo Tavares
Hello Jeff, See this simple script: print "Enter with the fisrst number\n"; my $num = ; 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 la

Re: Convert int for string

2007-08-25 Thread Rodrick Brown
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

Re: Convert int for string

2007-08-25 Thread Jeff Pang
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