Re: String to Numeric of an Array

2004-09-14 Thread Gunnar Hjalmarsson
Charles K. Clarkson wrote: Edward WIJAYA <[EMAIL PROTECTED]> wrote: I am terribly sorry to have asked such a trivial question. Never be sorry for asking questions. Trivial or complex. We answer questions. If you feel intimidated to ask future questions then we have failed. Even if I see nothing wro

RE: String to Numeric of an Array

2004-09-14 Thread Charles K. Clarkson
Edward WIJAYA <[EMAIL PROTECTED]> wrote: : : I am terribly sorry to have asked such a trivial : question. Never be sorry for asking questions. Trivial or complex. We answer questions. If you feel intimidated to ask future questions then we have failed. HTH, Charles K. Clarkson -- Mobile

Re: String to Numeric of an Array

2004-09-14 Thread Edward WIJAYA
If you treat the elements of the array as numbers, won't things Just Work ? Thanks a lot for the reply. The reason I asked this because, in one of my regex operation I doubted that the results are correct. Turns out that I am wrong :( I guess I am still living in C-world. I am terribly sorry to h

Re: String to Numeric of an Array

2004-09-14 Thread David Greenberg
; Matt Shaw > http://www.thinktechnology.ca/ > > > -Original Message- > > From: Edward WIJAYA [mailto:[EMAIL PROTECTED] > > Sent: Tuesday, September 14, 2004 10:12 PM > > To: [EMAIL PROTECTED] > > Subject: String to Numeric of an Array > > > >

RE: String to Numeric of an Array

2004-09-14 Thread Shaw, Matthew
27;1', '2', '3'); print $array[0] + 1; Output: 2 Hope this helps. Matt Shaw http://www.thinktechnology.ca/ > -Original Message- > From: Edward WIJAYA [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 14, 2004 10:12 PM > To: [EMAIL PROTECTED] >

Re: String to Numeric of an Array

2004-09-14 Thread Chris Devers
On Wed, 15 Sep 2004, Edward WIJAYA wrote: > How can I change the value of this array: > > @array = ['1','2','3']; #which contain "string" numeric > > to > > @arrayNum = [1,2,3]; #as pure numeric Does this even need to be done? If you treat the elements of the array as numbers, won't things

Re: String to Numeric of an Array

2004-09-14 Thread John W. Krahn
Edward WIJAYA wrote: Hi, Hello, How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric As far as perl is concerned they are the same. If you use a string in numeric context it becomes a number and if you use a nu

Re: String to Numeric of an Array

2004-09-14 Thread Gunnar Hjalmarsson
Edward WIJAYA wrote: How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric Why would you need that? my $string = '5'; my $number = 5; print "Equal\n" if $string == $number; -- Gunnar Hjalmarsson Email:

String to Numeric of an Array

2004-09-14 Thread Edward WIJAYA
Hi, How can I change the value of this array: @array = ['1','2','3']; #which contain "string" numeric to @arrayNum = [1,2,3]; #as pure numeric Regards, Edward WIJAY -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]