You don't need to do anything. Perl is not strongly typed, so there's no casting that needs to be done by you. It's based on the context in which you use the var.
Can you provide a code snippet where you think you need the type casting and explain the problem that you're seeing?
Comment