On 07/31/2006 11:29 AM, Dr. Claus-Peter Becke wrote:
Mumia W. schrieb:
On 07/31/2006 07:20 AM, Dr. Claus-Peter Becke wrote:
dear mumia w,
thank for your support. as you supposed the values aren't equal. 
the subroutine's argument is "1". had databaserequest_noun been 
interpreted in scalar context inside the if-clause, with the result 
that its value is an integer and not a string as required? is this 
the reason why the comparison doesn't succeed? and how can i make 
sure that databaserequest_noun will be interpreted as an 
array-variable?
best regards
claus-peter becke
if ((function_name($var1,$var2))[0] eq 'MyString') {
}
HTH
dear mumia w,
i have tested the proposal you've made the following way:
  if ((databaserequest_noun($col, $table, $case) )[0] eq 
$Q::lexicalentry) {
  print $q->p("the entry is part of the database");
}else { print    $q->p("the entry isn't part of the database");}
unfortunately it doesn't work. i don't understand the meaning of [0]. 
could you please explain what's about this expression?
best regards
claus-peter becke
[ Redirected to the list/posted and mailed ]
Again, find out what databaserequest_noun() returns by assigning to a 
new variable first then printing or by using Data::Dumper:
print Dumper(\databaserequest_noun($col, $table, $case));
The (function())[0] syntax puts the function call into list context so 
that you can get the first array element ([0]) rather than the array 
size.