Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Class::DBI insert error

by rhesa (Vicar)
on Jan 21, 2008 at 10:59 UTC ( [id://663355]=note: print w/replies, xml ) Need Help??


in reply to Class::DBI insert error

In scalar context, search() returns an iterator. You can't use that as a record value.

Either do:

# Note the braces to force list context on the left hand side my ($roleid) = autocd::roles->search(rolename => $rolename);

or

my $role_iter = autocd::roles->search(rolename => $rolename); if (!$role_iter->count || !$username){ return ""; } my $roleid = $role_iter->first;

I'd go for the first option.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://663355]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-18 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found