
yankee338
New User
May 6, 2009, 7:04 AM
Post #1 of 3
(248 views)
|
|
test for array of arrays
|
Can't Post
|
|
I have a ref to an array. If it's a single value, then warn Dumper($allresults)->[0][0] will cause the code to fail, but an array of arrays will work. So, I'm trying to build an if statement to test if it is an array of arrays. I thought i could do this if (exists $allresults->[0][0]) { warn "it is array of array"; } but the problem is that this fails due to "can't use string ("111.9") as an ARRAY ref while "strict refs" in use. How can I test if this is an array of array or not. I'm not interested in removing the use strict requirement. Thanks
(This post was edited by yankee338 on May 6, 2009, 7:43 AM)
|