Accordingly with the perlvar manpage, $@ is used for error messages produced by eval.
I would like to use it as a more general variable for error messages. When a function returns a string, there isn't much that can be done to return a error string. Probably returning a list, setting an object, nothing clean and simple as real perl code
What I want is to use $@. The function will return undef and set $@ to the error message. This is clean enough and should work.
But I have some doubts: is there any problem on using this approach? In the function I probably need to clean up $@ and assign undef to it?