aloknath:
A couple of things:
You're aware that test is already in bash, aren't you? You might want to use a different name so future maintainers don't assume they know what test is.
Calling functions from bash isn't going to pass it variable values. It may be better to get more familiar with perl by converting the functions from bash to perl.
With the given system command, bash will try to execute commands that it already knows about. So you'll need to figure out a way to preload your functions.
Overall, it's probably too much work, and probably too error prone to attempt it. (At least from my perspective...) Again, converting from bash to perl would be a good exercise, and shouldn't be very difficult.
...roboticus