rdfield is right on the money.
Pay attention to exactly what error message are trying to tell you - they are usually pretty easy to understand if you take a minute and really look at it. Notice
Here's your code:Use of uninitialized value in numeric eq (==) at Creating_table_D.pl line 31. Use of uninitialized value in numeric eq (==) at Creating_table_D.pl line 35.
sub create_table ($) { my($schema_in) = $_; if ($schema_in == "1"){ # offending line 1 my @tables = qw/A/; } if ($schema_in == "2"){# offending line 2 my @tables = qw/A B C/; }
Notice in particular Use of uninitialized value. This probably means that $schema_in has *NO* value. As rdfield suggested, do some debugging - print out the value of $schema_in in subroutine 'create_table' to see if it is receiving the value you think it's receiving.
Notice another thing - when doing a numeric comparison, you don't want to test using *string* "1" - you want to test using number 1 - without quotes around it. If you include the quotes and $schema_in contains a number, then perl will have to convert the string to a number and then do the numeric comparison.
HTH.
In reply to Re: Re: uninitialized value in numeric eq (==)
by hmerrill
in thread uninitialized value in numeric eq (==)
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |