Always use two arguments for bless
, as $class
tells into which package should object be blessed. If $class
is omitted, the current package is used.
bless $self, $class;
output
$VAR1 = bless( {
'started' => 'Sun Sep 29 13:24:26 2013',
'full_name' => 'John Smith'
}, 'Objs::Manager' );
From perldoc -f bless
:
Always use the two-argument version if a derived class might inherit the function doing the blessing