in reply to Return Value in Subroutine

I don't see how your current code is working. Change this:
b::test($value);
to this:
$value = b::test();
With or without the return statement, the the last variable to be set (which is $value) will be returned.