On Thu, May 27, 2010 at 2:09 PM, Robert Morales <robertmorales...@gmail.com> wrote: > The error msg I get this time, is like this: > > r...@user# ./script.pl > 0 > Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line > 21, <$memory> line 3. > Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line > 23, <$memory> line 3. > 0 > Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line > 21, <$memory> line 4. > Use of uninitialized value $array[6] in numeric ge (>=) at ./script.pl line > 23, <$memory> line 4. > 0
It appears that $array[6] is uninitialized (it's equal to undef). It's warning you because you're using it as a number, which might indicate an error on your part so it lets you know. You can get rid of them by wrapping the entire if...elsif...else ladder in another if... if(defined $array[6]) { ... } So that it only prints a status message if that element exists in the array. Of course, the fact that it isn't defined at all suggests that the data you're processing isn't what you think it is. You might want to analyze the arrays you're getting back to make sure they're what you expect. You can use Data::Dumper to see what the array(s) look like: use Data::Dumper; ... print Dumper(\...@array); -- Brandon McCaig <bamcc...@gmail.com> V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl. Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org> -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/