Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array of element

Status
Not open for further replies.

hello99hello

Programmer
Jul 29, 2004
50
0
0
CA
Somewhat embarrassed to ask this question:

Could anyone tell me why the comment is not evaluating
if (($array[5] eq "FULL TIME") && ($array[11] eq "BCGE2")){
$array[5] = "ARREARS";
$array[11] = "ARREARS";
print "The element 5th is now $array[5] \n" ; #This is not comming out at all.
print "The element 11th is now $array[11] \n" ; #This is not working as well.

However, the following works:
if ($array[5] eq "FULL TIME"){
$array[5] = "ARREARS";
print "The element 5th is now $array[5] \n" ;
print "The element 11th is now $array[11] \n" ;

Thanks for your advise.
 
$array[11] probably isn't really what you think. Maybe it has a newline or a space on the end? Let's see more of the code. How are you initializing the array, and what do those print statements really print?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top