[Catalyst] putting an object in the stash

Octavian Rasnita orasnita at gmail.com
Tue Mar 13 12:18:17 GMT 2007


I know that an object is a blessed hash, but the DBIC objects are very 
complex, and I cannot use

$c->stash($obj);

If I do that, the values from $obj hash reference are not put in the 
template like when $obj is a reference to a common hash.

That's why I want to find how to put the key/values from $obj into a common 
hash.

Is it possible to do that without specifying all the keys by name? Or at 
least is there a way to get all the keys from $obj, then loop and create a 
hash, something like:

my $hash;
foreach(@keys) {
$hash->{$_} = $obj->$_;
}

Thanks.

Octavian 




More information about the Catalyst mailing list