Hello,

My script works but I keep getting one of the following 2 frustrating errors:  

    1- Use of uninitialized value in string eq...    
    2- Use of uninitialized value in concatenation (.) or string...

The error occurs the fourth time the subroutine is called.  According to 
perl.com, the error means - "This means that you're trying to use a variable 
before you've assigned a value to it"  I think the problem may be in the code 
snippet below, could it that $_[0] needs to be reinitialized?  If so, how?

my array = ("", "Y", "N");

function($scalar_value1); 

sub function {
    my ($value, $item, $selected);
    $value = $_[0];               #$_[0] should eq first (and only) value of 
$scalar_value1
    foreach $item(@array) {
            if ($item eq $value){                   
                    $selected = "selected";
            }
            print "<option value=\"$item\" $selected>$item</option>\n";
    }
}



-- 
_______________________________________________
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to