[CDBI] CDBI and grep

Rolf Schaufelberger rs at plusw.de
Mon Jan 16 10:27:56 GMT 2006


Hi, 
I have a table users and and a table columns, 
users has_a company_id. Now, If I have a expression like

my $user = XY::Users->retrieve(123);
if ( grep /$user->company_id->id/, ( 1, 2, 3 ) ) 

i get no match even if the company_id is on of 1,2,3.
Neither 
if ( grep /$user->company_id/, ( 1, 2, 3 ) ) 
nor
if ( grep /"$user->company_id"/, ( 1, 2, 3 ) ) 
match,but 
my $id =  $user->company_id->id;
if ( grep /$id/, ( 1, 2, 3 ) ) 
does. I have no idea why the other expressions  above fail. 
There is no stringify function for company.


Rolf Schaufelberger
rs at plusw.de




More information about the ClassDBI mailing list