Re: type comparison in perl

2007-09-01 Thread Rob Dixon
Peter Scott wrote: On Fri, 31 Aug 2007 15:08:01 -0400, Hunter Barrington wrote: is there a type() function in perl? i need to be able to test the contents of an array and if (type($value)=='string' or type($value)=='int') {print "i win";} thats basically what i need to be able to do. if it

Re: type comparison in perl

2007-09-01 Thread Peter Scott
On Fri, 31 Aug 2007 15:08:01 -0400, Hunter Barrington wrote: > is there a type() function in perl? i need to be able to test the > contents of an array and > if (type($value)=='string' or type($value)=='int') {print "i win";} > > thats basically what i need to be able to do. if it helps i know ah

Re: type comparison in perl

2007-08-31 Thread Chas Owens
On 8/31/07, Ken Foskey <[EMAIL PROTECTED]> wrote: > On Fri, 2007-08-31 at 15:08 -0400, Hunter Barrington wrote: > > is there a type() function in perl? i need to be able to test the > > contents of an array and > > if (type($value)=='string' or type($value)=='int') {print "i win";} > > if( $value =

Re: type comparison in perl

2007-08-31 Thread Ken Foskey
On Fri, 2007-08-31 at 15:08 -0400, Hunter Barrington wrote: > is there a type() function in perl? i need to be able to test the > contents of an array and > if (type($value)=='string' or type($value)=='int') {print "i win";} if( $value =~ m/^\d+$/ ) { print "I am a number\n"; } -- Ken Foskey

Re: type comparison in perl

2007-08-31 Thread Tom Phoenix
On 8/31/07, Hunter Barrington <[EMAIL PROTECTED]> wrote: > is there a type() function in perl? i need to be able to test the > contents of an array and > if (type($value)=='string' or type($value)=='int') {print "i win";} You probably meant to use the 'eq' (string equality) comparison operator in

Re: type comparison in perl

2007-08-31 Thread Gunnar Hjalmarsson
Hunter Barrington wrote: is there a type() function in perl? i need to be able to test the contents of an array and if (type($value)=='string' or type($value)=='int') {print "i win";} thats basically what i need to be able to do. if it helps i know ahead of time that the two type in the array

type comparison in perl

2007-08-31 Thread Hunter Barrington
is there a type() function in perl? i need to be able to test the contents of an array and if (type($value)=='string' or type($value)=='int') {print "i win";} thats basically what i need to be able to do. if it helps i know ahead of time that the two type in the array will always be a hashref o