in reply to Perl module symbol import versus direct invocation
Perl 5 doesn't really make much of a distinction between methods and functions. You can call a function as a method and a method as a function. There are two important differences:
That's why Test::MockObject works -- you can call a method with the function semantics and manually pass an invocant:
Everything::Node::node::update( $mock_node, $user );In your case, you're just having Perl look for Add_Delta_Days in Date::Calc or a parent class, call the nearest sub it finds, and pass 'Date::Calc' as the first argument. Since the module never planned for that, it'll pull the string into $year and that's when things break.
Date::Calc::Add_Delta_Days( $year, $month, $day, -3 );No inheritance lookup, no invocant passing.
|
|---|